写了一个应用程序,打开后不响应消息,窗口托不动,也关不掉,必须从任务管理器关闭,代码如下: 
#include <windows.h>
#include <stdio.h>
LRESULT CALLBACK WinSunProc(
HWND hwnd,      // handle to window
UINT uMsg,      // message identifier
WPARAM wParam,  // first message parameter
LPARAM lParam   // second message parameter
);
int WINAPI WinMain(
HINSTANCE hInstance,      // handle to current instance
HINSTANCE hPrevInstance,  // handle to previous instance
LPSTR lpCmdLine,          // command line
int nCmdShow              // show state
) {
WNDCLASS wndcls;
wndcls.cbClsExtra=0;
wndcls.cbWndExtra=0;
wndcls.hbrBackground=(HBRUSH)GetStockObject(BLACK_BRUSH);
wndcls.hCursor=LoadCursor(NULL,IDC_ARROW);
wndcls.hIcon=LoadIcon(NULL,IDI_WINLOGO);
wndcls.hInstance=hInstance;
wndcls.lpfnWndProc=WinSunProc;
wndcls.lpszClassName="dongge2012";
wndcls.lpszMenuName=0;
wndcls.style=CS_VREDRAW | CS_HREDRAW;
RegisterClass(&wndcls); HWND hwnd;
hwnd=CreateWindow("dongge2012","冬哥你好",WS_OVERLAPPEDWINDOW,50,50,500,600,NULL,NULL,hInstance,NULL);
ShowWindow(hwnd,SW_NORMAL);
UpdateWindow(hwnd);
MSG msg;
while(GetMessage(&msg,NULL,0,0));
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
} LRESULT CALLBACK WinSunProc(
HWND hwnd,      // handle to window
UINT uMsg,      // message identifier
WPARAM wParam,  // first message parameter
LPARAM lParam   // second message parameter
) {
switch (uMsg)
{
case WM_CHAR:
char szChar[20];
sprintf(szChar,"char is %d",wParam);
MessageBox(hwnd,szChar,"dongge",0);
break;
case WM_LBUTTONDOWN:
MessageBox(hwnd,"do not knock me","dongge",0);
HDC hdc;
hdc=GetDC(hwnd);
TextOut(hdc,10,30,"东哥传奇",strlen("东哥传奇"));
ReleaseDC(hwnd,hdc);
break;
case WM_RBUTTONDOWN:
MessageBox(hwnd,"do no push me","dongge",0);
HDC hdC;
hdC=GetDC(hwnd);
TextOut(hdC,30,50,"东哥传说",strlen("东哥传说"));
ReleaseDC(hwnd,hdC);
break; case WM_PAINT:
HDC hDC;
PAINTSTRUCT ps;
hDC=BeginPaint(hwnd,&ps);
TextOut(hDC,0,0,"东哥你好",strlen("东哥你好"));
EndPaint(hwnd,&ps);
break;
case WM_CLOSE:
if(IDYES==MessageBox(hwnd,"你是否真的要关闭程序?","dongge",MB_YESNO));
{
DestroyWindow(hwnd);
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd,uMsg,wParam,lParam);
}
return 0; }
 我想代码不会有错的,因为编译调试运行都不报错,连警告都没有,只是运行后就卡那不动了,已经纠结几天了,到底是什么原因? 是代码写错了,还是我电脑硬件问题或是系统问题还是.....,知道给解释下 先谢谢了...