Vielen Dank für die schnelle Rückmeldung.
Hier ist der Code:
#include <Windows.h>
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
static TCHAR const AppName[] = TEXT("WinAPItest");
WNDCLASS WC;
WC.style = 0;
WC.cbClsExtra = 0;
WC.cbWndExtra = 0;
WC.lpfnWndProc = WndProc;
WC.hInstance = hInstance;
WC.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
WC.hCursor = 0;
WC.hIcon = 0;
WC.lpszMenuName = 0;
WC.lpszClassName = AppName;
RegisterClass(&WC);
HWND hWindow;
hWindow = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW,
AppName,
TEXT("WinAPItest"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL);
ShowWindow(hWindow, nCmdShow);
UpdateWindow(hWindow);
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
DispatchMessage(&msg);
}
return (msg.wParam);
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT uiMessage, WPARAM wParam, LPARAM lParam) {
switch (uiMessage)
{
case WM_DESTROY:
PostQuitMessage(0);
return 0;
default:
return DefWindowProc(hWnd, uiMessage, wParam, lParam);
}
}