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;
}
Windowed - Fullscreen
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:
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.
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.
SM_CXSCREEN and SM_CYSCREEN I believe. Either that or SM_CXFULLSCREEN and SM_CYFULLSCREEN.
Throw those in your width/height parameters.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement