Do you mean to cover the whole screen?
Code:
#include <windows.h>
LRESULT CALLBACK WndProc(HWND hwnd,UINT Message,WPARAM wParam,LPARAM lParam);
int WINAPI WinMain( HINSTANCE hInst,
HINSTANCE hPreInst,
LPSTR lpszCmdLine,
int nCmdShow )
{
HWND hwnd;
MSG Msg;
TCHAR *szClassName = TEXT("SIMPLEWND");
WNDCLASSEX wcx = {0};
wcx.cbSize = sizeof(WNDCLASSEX);
wcx.style = CS_HREDRAW | CS_VREDRAW;
wcx.lpfnWndProc = (WNDPROC)WndProc;
wcx.hInstance = hInst;
wcx.hIcon = LoadIcon(NULL,IDI_APPLICATION);
wcx.hCursor = LoadCursor(NULL,IDC_ARROW);
wcx.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
wcx.lpszClassName = szClassName;
if (!RegisterClassEx(&wcx)){
return 1;
}
hwnd=CreateWindowEx(WS_EX_TOPMOST,
szClassName,
TEXT(""),
WS_POPUP | WS_VISIBLE,
0,
0,
GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN),
NULL,
NULL,
hInst,
NULL);
ShowWindow(hwnd,nCmdShow);
UpdateWindow(hwnd);
while (GetMessage(&Msg,NULL,0,0)>0){
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
return Msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hwnd,UINT Message,WPARAM wParam,LPARAM lParam)
{
switch (Message){
case WM_KEYDOWN:
if(wParam != VK_ESCAPE){//Press escpae to quit
PostQuitMessage(0);
return 0;
}
case WM_DESTROY:
PostQuitMessage(0);
return 0;
default:
return DefWindowProc(hwnd,Message,wParam,lParam);
}
}