LRESULT WINAPI myProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if(message == WM_CLOSE)
PostQuitMessage(0);
return 0;
}
int APIENTRY WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
MSG msg;
HWND myDialog = CreateWindowEx(
0,WC_DIALOG,"My Window",WS_OVERLAPPEDWINDOW | WS_VISIBLE,
400,100,200,200,NULL,NULL,NULL,NULL
);
SetWindowLong(myDialog, DWL_DLGPROC, (long)myProc);
while(GetMessage(&msg,NULL,0,0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
discuss this topic to forum
