LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
{
switch(message)
{
case WM_DESTROY:
PostQuitMessage(0);
default:
return:: DefWindowProc(hwnd,message,wParam,lParam);
}
return 0;
}
int WINAPI WinMain ( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine, int iCmdShow)
{
MSG Msg;
WNDCLASS wndclass;
static char name[]="HELLO";
wndclass.注册窗口失败"),0,0);
return FALSE;
}
HWND hwnd;
hwnd=CreateWindowEx( 0,
name,
TEXT("FIRST"),
WS_OVERLAPPEDWINDOW,
0,0,200,300,
NULL,
NULL,
hInstance,
NULL);
if(!hwnd)
{
a=GetLastError();
MessageBox(NULL,TEXT("窗口创建失败!"),0,0);
return FALSE;
}
ShowWindow(hwnd,SW_SHOW);
UpdateWindow(hwnd);
while(GetMessage(&Msg,NULL,0,0))
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
return Msg.wParam;
}