不知怎么回事,请高手提示一下,尤其是版主(如果有空的话),在此先谢过了,事先声明,我是新手,只要你花上几秒钟, 复制_帖贴_运行,就能发现问题的了,先谢过了,(即使只是路过)
代码:
#include <windows.h>
//int _tmain(int argc, _TCHAR* argv[])
//{
// return 0;
//}
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
//以下是初始化窗口类
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInst,LPSTR lpszCmdLine,int nCmdShow)
{
HWND hwnd;
MSG Msg;
WNDCLASS wndclass;
char lpszClassName[]="窗口";
char lpszTitle[]="My_Windows";
//窗口类的定义
wndclass.style=0;
wndclass.lpfnWndProc=WndProc;
wndclass.cbClsExtra=0;
wndclass.cbWndExtra=0;
wndclass.hInstance=hInstance;
wndclass.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wndclass.hCursor=LoadCursor(NULL,IDC_ARROW);
wndclass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName=NULL;
wndclass.lpszClassName=(LPCWSTR)*lpszClassName;
//
if(!RegisterClass(&wndclass))
{
MessageBeep(0);
return FALSE;
}
//
hwnd=CreateWindow
(
lpszClassName;
lpszTitle,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL
);
//
ShowWindow(hwnd,nCmdShow);
//
UpdateWindow(hwnd);
//
while(GetMessage(&Msg,NULL,0,0))
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
return Msg.wParam;
}
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);
}
[此贴子已经被作者于2006-3-13 12:35:04编辑过]