各位大仙帮帮忙吧
#include<Windows.h>#include<stdio.h>
LRESULT CALLBACK WindowProc( HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow
)
{
WNDCLASSEX wcex;
wcex.cbSize=sizeof(WNDCLASSEX);
wcex.style=WS_HSCROLL|WS_VSCROLL|WS_POPUP;
wcex.lpfnWndProc=WindowProc;
wcex.cbClsExtra=0;
wcex.cbWndExtra=0;
wcex.hbrBackground=(HBRUSH)GetStockObject(BLACK_BRUSH);
wcex.hCursor=LoadCursor(NULL,IDC_CROSS);
wcex.hIcon=LoadIcon(NULL,ERROR);
wcex.hInstance=hInstance;
wcex.lpszClassName=L"chuanchuan";
wcex.lpszMenuName=NULL;
wcex.hIconSm=LoadIcon(wcex.hInstance,MAKEINTRESOURCE(IDI_APPLICATION));
RegisterClassEx(&wcex);
HWND hwnd;
hwnd=CreateWindowEx(WS_EX_ACCEPTFILES,L"WindowProc",L"chuanchuan",WS_OVERLAPPEDWINDOW,0,0,600,400,NULL,NULL,hInstance,NULL);
ShowWindow(hwnd,SW_SHOWNORMAL);
UpdateWindow(hwnd);
MSG msg;
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
LRESULT CALLBACK WindowProc( HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
switch(uMsg)
{
case WM_CHAR:
MessageBoxEx(hwnd,L"shijietafuza",L"wushouchuan",0,0);
break;
case WM_LBUTTONDOWN:
MessageBoxEx(hwnd,L"shengming",L"wushouchuan",0,0);
HDC hdc;
hdc=GetDC(hwnd);
TextOut(hdc,0,50,L"chuangege",strlen("chuangege"));
ReleaseDC(hwnd,hdc);
break;
case WM_PAINT:
PAINTSTRUCT ps;
hdc=BeginPaint(hwnd,&ps);
TextOut(hdc,0,100,L"aiqing",strlen("aiqing"));
EndPaint(hwnd,&ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_CLOSE:
if(IDYES==MessageBoxEx(hwnd,L"shifoutuichu",L"wushouchuan",MB_YESNO,0))
{
DestroyWindow(hwnd);
}
break;
default:
return DefWindowProc(hwnd,uMsg,wParam,lParam);
break;
}
return 0;
}
这个程序可以生成,调试也没错,但是没法显示出来窗口,求各位大仙指教