各位高手,看看我这个程序,为什么窗口不出来啊!!!!!!!!!!!1急用
sql1 2005-03-22 11:24:20 #include<windows.h>
#include<windowsx.h>
LRESULT CALLBACK WindowProc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam);
int WINAPI WinMain(HINSTANCE hinstance,HINSTANCE hpreinstance,LPSTR lpcmdline,int ncmdshow)
{
WNDCLASSEX winclass;
winclass.cbSize=sizeof(WNDCLASSEX) ;
winclass.style= CS_HREDRAW|CS_VREDRAW;
winclass.lpfnWndProc=(WNDPROC)WindowProc;
winclass.cbClsExtra=0;
winclass.cbWndExtra=0;
winclass.hInstance=hinstance;
winclass.hIcon=NULL;
winclass.hCursor=NULL;;
winclass.hbrBackground=(HBRUSH)GetStockObject(GRAY_BRUSH);
winclass.lpszMenuName=NULL;
winclass.lpszClassName="WINCLASS1";
winclass.hIcon=NULL;
RegisterClassEx(&winclass);
HWND hwnd;
hwnd = CreateWindowEx(NULL,"WINCLASS1", "GUOYIWE WINDOWS", WS_OVERLAPPEDWINDOW,CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hinstance, NULL);
//hwnd=CreateWindow("WINCLASS1","GUOYIWE WINDOWS"
/// ,WS_OVERLAPPEDWINDOW,0,0,400,400,NULL,NULL,hinstance,NULL);
ShowWindow(hwnd,SW_SHOW);
UpdateWindow(hwnd);
MSG sMsg;
while (GetMessage(&sMsg, NULL, 0, 0))
{
TranslateMessage(&sMsg);
DispatchMessage(&sMsg);
}
return((int) sMsg.wParam);
// return 0;
}
LRESULT CALLBACK WindowProc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam)
{
switch(msg)
{
case WM_DESTROY:
return(0);
break;
}
return(DefWindowProc(hwnd,msg,wparam,lparam));
}