#include
#include
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);//windpws main' diclare
//以下初始化窗口类
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInst,LPSTR IpszCmdLine,int nCmdShow)
{
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
char IpszClassName[]="窗口";
char IpszTitle[]="My_Windows";
//窗口类定义
wndclass.style=0;
wndclass.IpfnWndProc=WndProc;
wndclass.cbClsExtra=0;
wndclass.hInstance=hInstance;
wndclass.hIcon=(NULL,IDI_APPLICATION);
wndclass.hCursor=LoadCursor(NULL,IDC_ARROW);
wndclass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.IpszMenuName=NULL;
wndclass.IpszClassName=IpszClassName;
//以下进行窗口类的注册
if(!RegisterClass(&wndclass))
{
MessageBeep(0);
return FALSH;
}
//创建窗口
hwnd=CreateWindow(IpszClassName,IpszTitle,WS_OVERLAPPEDEWINDOW,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;
}
//窗口函数
LURESULT CALLBACK Wndproc(HWND hwnd,UINT message,WPARAM wParam,LPARAM Iparam)
{
switch(message)
{
case WM_DESTROY:
PostQuitMessage(0);
default:
return DefWindowProc(hwnd,message,wParam,IParam);
}
return (0);
}
这个程序杂出现了八个错误呀,我怎么也找不出错在那,
下面这位老兄的回答很不错,在编译时零个错误,但是运行时却出现了两错误,难道是编译器的问题吗?搞不懂!
那位老兄能帮解决一下,还有我想是不是下面这为老兄只考虑到编译,而忽略了程序运行时错误,
#include LRESULT CALLBACK Wndproc(HWND,UINT,WPARAM,LPARAM);//windpws main' diclare //以下初始化窗口类 int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInst,LPSTR IpszCmdLine,int nCmdShow) { HWND ...