|
#include "stdafx.h"
HWND g_hWnd; // Window handle
char g_szClass[] = "EnumDemo"; // Class name
LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg) {
case WM_DESTROY:
PostQuitMessage(0);
break;
default:return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
return 0;
}
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
g_hWnd = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DIALOG), 0, NULL);
UpdateWindow(g_hWnd);
ShowWindow(g_hWnd, nCmdShow);
MSG Msg;
while(GetMessage(&Msg, NULL, 0, 0)) {
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
return 0;
}
上面的对话框无法关闭 为什么? |
|