Thread: Fullscreen Mode still showing window

  1. #1
    Bioport Productions
    Join Date
    Oct 2005

    Fullscreen Mode still showing window

    Ok, I'm using DirectX to set up my engine and I'm nearly done with it. This is a problem I've been having since day 1 and can't find a way to fix it. Fullscreen works fine but...I can still drag/close/minimize the window through directX. I can't see the window, but if I know where to click, I can minimize it, etc. I've tried using styles without close buttons and disabling the window but I can still minimize it if I double click the title bar. I know there's a way around this, anyone know?
    -"What we wish, we readily believe, and what we ourselves think, we imagine others think also."
    PHP Code:

  2. #2
    Registered User
    Join Date
    May 2005
    Can you show us the methods used to create the window? And the initialization code you use with DirectX?

    Specifically the CreateWindow[Ex] calls and such, and the init directdraw/3d calls.

  3. #3
    Bioport Productions
    Join Date
    Oct 2005
    Sure, here's how I create the window:
    wcex.cbSize = sizeof( WNDCLASSEX ); //size of the structure = CS_CLASSDC; //the class style
    	wcex.lpfnWndProc = (WNDPROC)MsgProc; //Window procedure callback
    	wcex.cbClsExtra = 0; //Extra class bytes
    	wcex.cbWndExtra = 0; //Extra window bytes
    	wcex.hInstance = hInstance; //Handle to the app instance
    	wcex.hIcon = NULL; // icon
    	wcex.hCursor = LoadCursor(NULL, IDC_ARROW); //cursor
    	wcex.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH); //bgcolor
    	wcex.lpszMenuName = NULL; //resource name for the menu
    	wcex.lpszClassName = "Arkhana"; //class name being created
    	wcex.hIconSm = NULL; //Small icon handle
    	RegisterClassEx( &wcex );
    	//Create the window
    	wndHandle = CreateWindow( "Arkhana", // Class name to use
    		Title, // Title bar text
    		WS_DISABLED, //The window style
    		0, // The starting x coord
    		0, // The starting y coord
    		1024, // The pixel width
    		768, // The pixel height
    		NULL, // The parent window, null for desktop
    		NULL, // The menu for the app - null for none
    		hInstance, // The handle to the app instance
    		NULL); // No values passed to the window
    Init D3D
    ZeroMemory( &d3dpp, sizeof(d3dpp) );
    	d3dpp.Windowed = false;
    	d3dpp.SwapEffect = D3DSWAPEFFECT_FLIP;
    	d3dpp.BackBufferCount = 1;
    	d3dpp.BackBufferHeight = 768;
    	d3dpp.BackBufferWidth = 1024;
    	d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
    	d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
    d3dpp.BackBufferFormat = Format;
    	d3dpp.EnableAutoDepthStencil = TRUE;
    	d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
    	d3dpp.hDeviceWindow = wndHandle;
    -"What we wish, we readily believe, and what we ourselves think, we imagine others think also."
    PHP Code:

  4. #4
    Registered User
    Join Date
    Apr 2002
    Try using the call:

    D3DDISPLAYMODE d3dmode;
    g_pD3d9->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3dmode);
    This will give you the width, height and format for full-screen mode. Use the format for the Back Buffer format in your D3DPRESENT_PARAMETERS struct, as well as the width and height. Also, why do you use WS_DISABLED for your window style? Why not try something like WS_OVERLAPPED. Or even WS_EX_TOPMOST would be great if you were using CreateWindowEx.

    So what is the problem you are experiencing exactly? Give some more details and I will try to help you further.
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

  5. #5
    Bioport Productions
    Join Date
    Oct 2005
    The reason it was WS_DISABLED is because I could close the window while DirectX was in fullscreen. When DirectX is in fullscreen mode, the window didn't disappear, it was behind DirectX in the background. I couldn't see the window but if I knew where it was I could close it by clicking the X and it would shut the whole program down...that's why it was disabled. I did fix it though. I used WS_OVERLAPPED first, it's the one that generated the problem. WS_POPUP|WS_VISIBLE did the trick though.
    -"What we wish, we readily believe, and what we ourselves think, we imagine others think also."
    PHP Code:

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  2. Adding buttons, edit boxes, etc to the window
    By rainmanddw in forum Windows Programming
    Replies: 1
    Last Post: 04-10-2006, 03:07 PM
  3. Why only 32x32? (OpenGL) [Please help]
    By Queatrix in forum Game Programming
    Replies: 2
    Last Post: 01-23-2006, 02:39 PM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM