int WINAPI WinMain(....)
{
MSG msg;
WNDCLASS wc={0};
wc.lpszClassName="MyClass";
wc.lpfnWndProc=DefWindowProc;
wc.hInstance=hInstance;
wc.hbrBackground=(HBRUSH)(COLOR_3DFACE+1);
wc.hCursor=LoadCursor(NULL,IDC_ARROW);
if (!RegisterClass(&wc)) {}
HWND hwnd;
hwnd=CreateWindowEx(0,wc.lpszClassName,0,WS_POPUP|WS_VISIBLE|WS_SYSMENU,9,9,99,99,0,0,0,0);
if (!hwnd) {}
while(GetMessage(&msg,0,0,0)>0)DispatchMessage(&msg);
return 0;
}
If you want to get the border, you can add WS_BORDER or WS_DLGFRAME (not both). If you do not want to show the window on the taskbar, add the advanced style WS_EX_TOOLWINDOW.
What do you need for bitwise OR styles; OR will combine all the values โโof the style, and is used (by window) to check which styles are set. Let's say we had two styles (WS_FOO = 1, WS_BAR = 2):
- 1 AND 2 = 0 (binary: 01 AND 10 = 00)
- 1 OR 2 = 3 (binary: 01 OR 10 = 11)
See wikipedia for more details .