okay
12-02-2004, 08:25
Ho questo problema:
Premendo il tasto F1 da windows normale vado in fullscreen ma se ripremo F1 mi ritorna la finestra senza bordi ne la barra con l'icona?????
Sembra che questa linea di codice non abbia effetto:
SetWindowLong( hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_SYSMENU | WS_BORDER | WS_CAPTION | WS_VISIBLE | WS_MINIMIZEBOX );
Questa è la routine........chiaramente prima resetto i parametri
m_pD3DDevice->Reset( &d3dpp )
.....e poi
ToggleFullScreen();
HRESULT CGame::ToggleFullScreen()
{
HRESULT hr;
m_bReady = false;
if( m_Fscreen )
{
// Set windowed mode style
SetWindowLong( hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_SYSMENU | WS_BORDER | WS_CAPTION | WS_VISIBLE | WS_MINIMIZEBOX );
d3dpp.Windowed = true;
m_Fscreen=false;
}
else
{
// Set fullscreen mode style
SetWindowLong( hWnd, GWL_STYLE, WS_POPUP | WS_SYSMENU | WS_VISIBLE );
d3dpp.Windowed = false;
m_Fscreen=true;
}
//LogInfo("<li>m_Fscreen dopo %d.", m_Fscreen);
// Setup the new presentation parameters
d3dpp.hDeviceWindow = hWnd;
if( m_Fscreen == true )
{
d3dpp.BackBufferWidth = m_rcWindowClient.right - m_rcWindowClient.left;
d3dpp.BackBufferHeight = m_rcWindowClient.bottom - m_rcWindowClient.top;
d3dpp.BackBufferFormat = m_d3dfmtFullscreen;
d3ddm.Format : d3ddm.Format;
}
else
{
d3dpp.BackBufferWidth = m_dwCreationWidth;
d3dpp.BackBufferHeight = m_dwCreationHeight;
d3dpp.BackBufferFormat = m_dmDesktop.Format;
}
if( FAILED( hr = Resize3DEnvironment() ) )
{
return hr;
}
// If in windowed mode, adjust the window size.
if( m_Fscreen )
{
SetWindowPos( hWnd, HWND_NOTOPMOST,
m_rcWindowBounds.left, m_rcWindowBounds.top,
m_rcWindowBounds.right - m_rcWindowBounds.left,
m_rcWindowBounds.bottom - m_rcWindowBounds.top,
SWP_SHOWWINDOW );
Premendo il tasto F1 da windows normale vado in fullscreen ma se ripremo F1 mi ritorna la finestra senza bordi ne la barra con l'icona?????
Sembra che questa linea di codice non abbia effetto:
SetWindowLong( hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_SYSMENU | WS_BORDER | WS_CAPTION | WS_VISIBLE | WS_MINIMIZEBOX );
Questa è la routine........chiaramente prima resetto i parametri
m_pD3DDevice->Reset( &d3dpp )
.....e poi
ToggleFullScreen();
HRESULT CGame::ToggleFullScreen()
{
HRESULT hr;
m_bReady = false;
if( m_Fscreen )
{
// Set windowed mode style
SetWindowLong( hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_SYSMENU | WS_BORDER | WS_CAPTION | WS_VISIBLE | WS_MINIMIZEBOX );
d3dpp.Windowed = true;
m_Fscreen=false;
}
else
{
// Set fullscreen mode style
SetWindowLong( hWnd, GWL_STYLE, WS_POPUP | WS_SYSMENU | WS_VISIBLE );
d3dpp.Windowed = false;
m_Fscreen=true;
}
//LogInfo("<li>m_Fscreen dopo %d.", m_Fscreen);
// Setup the new presentation parameters
d3dpp.hDeviceWindow = hWnd;
if( m_Fscreen == true )
{
d3dpp.BackBufferWidth = m_rcWindowClient.right - m_rcWindowClient.left;
d3dpp.BackBufferHeight = m_rcWindowClient.bottom - m_rcWindowClient.top;
d3dpp.BackBufferFormat = m_d3dfmtFullscreen;
d3ddm.Format : d3ddm.Format;
}
else
{
d3dpp.BackBufferWidth = m_dwCreationWidth;
d3dpp.BackBufferHeight = m_dwCreationHeight;
d3dpp.BackBufferFormat = m_dmDesktop.Format;
}
if( FAILED( hr = Resize3DEnvironment() ) )
{
return hr;
}
// If in windowed mode, adjust the window size.
if( m_Fscreen )
{
SetWindowPos( hWnd, HWND_NOTOPMOST,
m_rcWindowBounds.left, m_rcWindowBounds.top,
m_rcWindowBounds.right - m_rcWindowBounds.left,
m_rcWindowBounds.bottom - m_rcWindowBounds.top,
SWP_SHOWWINDOW );