Sign in to follow this  

Windowed - Fullscreen

This topic is 4594 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, Well, like the title might predict, I would like to know how to get my Win32 App fullscreen. I use VC 6.0 This is my main function:
INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR, INT)
{
	char *Name = "Delego Qualitas";

    // Register the window class
    WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L,
                      GetModuleHandle(NULL), NULL, NULL, NULL, NULL,
                      Name, NULL };
    RegisterClassEx(&wc);

    hWnd = CreateWindow(Name, Name,	WS_DLGFRAME , 0, 0, 800, 800, GetDesktopWindow(), 
						NULL, wc.hInstance, NULL);

    // Create the application's window
	SetTimer(hWnd, IDT_KEYBOARD, 1000/100,(TIMERPROC) NULL);

    // Initialize Direct3D
    if(SUCCEEDED(InitD3D(hWnd)))
    {
        // Create the geometry
        if(SUCCEEDED(InitGeometry()))
        {
			
            // Show the window
            ShowWindow(hWnd, SW_SHOWDEFAULT);
            UpdateWindow(hWnd);

			DirectInput8Create(hInst, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&lpDInput, NULL);
						
			lpDInput->CreateDevice(GUID_SysKeyboard, &lpKeyboard, NULL);
			
			lpKeyboard->SetDataFormat(&c_dfDIKeyboard);
			lpKeyboard->SetCooperativeLevel(hWnd, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE);
			lpKeyboard->Acquire();			
			
			
            // Enter the message loop
            MSG msg;
            ZeroMemory(&msg, sizeof(msg));
            while(msg.message != WM_QUIT)
            {
                if(PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE))
                {
                    TranslateMessage(&msg);
                    DispatchMessage(&msg);
                }
                else
                    Render();
            }
        }
    }
	if (lpDInput) 
    { 
        if (lpKeyboard) 
        {  
            lpKeyboard->Unacquire(); 
            lpKeyboard->Release();
            lpKeyboard = NULL; 
        } 
        lpDInput->Release();
        lpDInput = NULL; 
    }
	KillTimer(hWnd, 1);
    UnregisterClass(Name, wc.hInstance);
    return 0;
}

I was wondering, how to get fullscreen with your CreateWindow function or which window style I should use. I might be entirely off on this, please correct me if so.

Share this post


Link to post
Share on other sites
If you want to do it in Windows, look at GetSystemMetrics

SM_CXSCREEN and SM_CYSCREEN I believe. Either that or SM_CXFULLSCREEN and SM_CYFULLSCREEN.

Throw those in your width/height parameters.

Share this post


Link to post
Share on other sites
Hmmm.

ascorbic and I interpreted this question as "how do I make this a 'fullscreen application'?"

xllx_relient_xllx and Maega interpreted it as "how do I make my window take up the whole screen?"

Now I wonder which one Xeile meant.

Oh well. Either way he has his answer.

Share this post


Link to post
Share on other sites

This topic is 4594 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this