Here is some very old code ( dated in the year 2000 ) by me. Maybe it is useful. It
just creates a borderless window. Press Escape to quit (exe included).
//
// old code by benny!weltenkonstrukteur.de
//
// ** Includes (System) **************************************************************
#include <windows.h>
// ** Definitionen (System) **********************************************************
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;
// ** Globals **************************************************************
static int cxClient, cyClient ; // Speichert die X-,Y-Größe von Windows
// ** WinMain (System) ***************************************************************
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
static TCHAR szAppName[] = TEXT ("test") ;
HWND hwnd ;
MSG msg ;
WNDCLASS wndclass ;
cxClient = GetSystemMetrics (SM_CXSCREEN) ; // get x resolution
cyClient = GetSystemMetrics (SM_CYSCREEN) ; // get y resolution
wndclass.style = CS_HREDRAW | CS_VREDRAW ;
wndclass.lpfnWndProc = WndProc ;
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = 0 ;
wndclass.hInstance = hInstance ;
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
wndclass.lpszMenuName = NULL ;
wndclass.lpszClassName = szAppName ;
if (!RegisterClass (&wndclass))
{ // UNICODE
MessageBox (NULL, TEXT ("Error in Class Registration - Sorry !"),
szAppName, MB_ICONERROR) ;
return 0 ;
}
hwnd = CreateWindow (szAppName, // name of windowclass
TEXT ("coming art production 2ooo"), // window title
WS_POPUPWINDOW , // window style
0, // x pos
0, // y pos
cxClient, // width
cyClient, // height
NULL, // parent window
NULL, // menu
hInstance, // program id
NULL) ; // additional param
ShowWindow (hwnd, SW_SHOWMAXIMIZED) ;
UpdateWindow (hwnd) ;
// Weird solution for Run-Time failure #3
memset( &msg, 0, sizeof(msg) );
while (msg.message != WM_QUIT)
{
if(PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
{
if(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
}
return 0;
}
// ** WndProc (System) ***************************************************************
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_CREATE:
return 0 ;
case WM_DESTROY:
case WM_CLOSE:
case WM_QUIT:
PostQuitMessage(0) ;
return 0 ;
break;
case WM_KEYDOWN:
PostMessage(hwnd, WM_DESTROY, 0, 0) ;
break;
}
return DefWindowProc (hwnd, message, wParam, lParam) ;
}