   Fullscreen and Windowed Mode
  hi allworking on toggling my app from full screen to windowed.its working with one issue.when i go full screen, then back to windowed mode, the app isalways topmost. i create the window like this:WNDCLASSEX wcex;   wcex.cbSize   = sizeof(WNDCLASSEX);   wcex.style    = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;   wcex.lpfnWndProc   = WndProc;   wcex.cbClsExtra    = 0;   wcex.cbWndExtra    = 0;   wcex.hInstance= hInstance;   wcex.hIcon    = LoadIcon ( hInstance, MAKEINTRESOURCE ( IDI_ICON1 ) );   wcex.hCursor  = LoadCursor ( NULL, IDC_ARROW );   wcex.hbrBackground = NULL;   wcex.lpszMenuName  = NULL;    wcex.hIconSm  = LoadIcon ( wcex.hInstance, MAKEINTRESOURCE ( IDI_ICON1 ) );   wcex.lpszClassName = APPLICATION_NAME; RegisterClassEx ( &wcex );  DWORD m_dwWindowStyle = WS_SYSMENU | WS_POPUP | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_THICKFRAME | WS_CAPTION; m_hWnd = CreateWindow ( APPLICATION_NAME, szWindowName, m_dwWindowStyle, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL ); when i switch modes to fullscreen, my presentation params look like this:ZeroMemory ( &m_d3dpp, sizeof(m_d3dpp) );   m_d3dpp.AutoDepthStencilFormat= D3DFMT_D24S8;   m_d3dpp.BackBufferCount  = 1;   m_d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;   m_d3dpp.BackBufferWidth  = 1024;   m_d3dpp.BackBufferHeight = 768;   m_d3dpp.EnableAutoDepthStencil= TRUE;   m_d3dpp.Flags  = 0;   m_d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;   m_d3dpp.hDeviceWindow    = m_hWndDemo;   m_d3dpp.MultiSampleQuality    = 0;   m_d3dpp.MultiSampleType  = D3DMULTISAMPLE_NONE;   m_d3dpp.PresentationInterval  = D3DPRESENT_INTERVAL_IMMEDIATE;   m_d3dpp.SwapEffect  = D3DSWAPEFFECT_DISCARD;   m_d3dpp.Windowed    = false;   m_d3dpp.MultiSampleQuality    = 0;   m_d3dpp.MultiSampleType  = D3DMULTISAMPLE_NONE; if ( FAILED ( m_pD3D->CreateDevice ( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,  m_hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE | D3DCREATE_MULTITHREADED, &m_d3dpp,&m_pd3dDevice ) ) ) { MessageBox ( m_hWndDemo, "CreateDevice() failed. The program will now exit.", "Error", MB_OK ); return E_FAIL; } then, to be able to see the window, I have to call SetWindowPos ( m_hWndDemo, NULL, 0, 0, nRight, nBottom, SWP_SHOWWINDOW );what am i missing?do i need to call createWindow() when flipping between full screen and windowed?thanks-programmer_tom
This recent thread may be of interest. And no, you don't need to (And indeed you shouldn't) re-create the window when toggling between windowed and fullscreen.   ;  thanks a bunch steveSetWindowPos ( m_hWndDemo, HWND_NOTOPMOST, 0, 0, nRight, nBottom, SWP_SHOWWINDOW );NOTOPMOST needs to be explicitly declared.you would think the absence of HWND_TOPMOST would make it HWND_NOTOPMOST but what do i know?-tom