如何加入大v店:一个关于windows程序设计的问题

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/04 23:49:38
源代码是:
#define STRICT
#include<windows.h>
#include<windowsx.h>
#pragma warning(disable:4068)
#pragma warning(disable:4100)

static char szAppName[]="Window1";
static HWND MainWindow;

LRESULT CALLBACK_export WndProc(HWND hWindow,UINT Message,
WPARAM wParam,LPARAM lParam);
BOOL Register(HINSTANCE hInst);
HWND Creat(HINSTANCE hInst,int nCmdShow);
#pragma arsused
int PASCAL WinMain(HINSTANCE hInst,HINSTANCE hPrevinstance,
LPSTR lpszCmdParam,int nCmdShow)
{
MSG Msg;
if(!hPrevinstance)
if(!Register(hInst))
return FAULSE;

IF(!(MainWindow=Create(hInst,nCmdShow)));
while(getmessage(&msg,null,0,0))
{
translatemessage(&msg);
dispatchmessage(&msg);
}
return msg.wparam;
}
bool register(hinstance hinst)
{
WNDCLASS WndClass;
WndClass.style=CS_HREDRAW|CS_VREDRAW;
WndClass.lpfnWndProc=WndProc;
WndClass.cbClsExtra=0;
WndClass.cbWndExtra=0;
WndClass.hInstance=hInst;
WndClass.hIcon=LoadIcon(NULL,ID_APPLICATION);
WndClass.hCursor=LoadCursor(NULL,IDC_ARROW);
WndClass.hbrBackgroundGetStockBrush(WHITEBRUSH);
WndClass.lpszClassNameszAppName;
WndClass.lpszMenuName=NULL;

return RegisterClass(&WndClass);
HWND Create(histance hinstance,int ncmdshow)
{
hwnd hwindow=createwindow(szappname,szappname,
ws_overlappedwindow,cw_usedefault,cw_usedefault,
cw_usedefault,cw_usedefault,null,null,hinstance,null)

if(hwindow==null)
return hwindow;
showwindow(hwindow,ncmdshow);
updatewindow(hwindow);
return hwindow;
}
#define window1_defproc defwindowproc;
void window1_ondestroy(hwnd hwnd);
lresult callback_export wndpro(hwnd hwindow,unit message,
wprama wparam,lparam lparam)
{
switch(message)
{

handle_msg(hwindow,wm_destroy,window1_ondestroy;
default:
return window1_defproc(hwindow,message,wparam,lparam);
}
}
#pragma argsused
void window1_ondestroy(hwnd hwnd)
{
postquitmessage(0);
}

编译后有错误:

1: error C2146: syntax error : missing ';' before identifier 'WndProc'
2 : fatal error C1004: unexpected end of file found
Error executing cl.exe.

不知道怎么改,麻烦大家帮帮忙!!!!

1.错误号C2146:语法错误:在定义WndProc之前遗漏了;号(可能是分号吧)
2.致命错误C1004:文件结束边界不确定
错误执行 cl.exe

至于错误号,你可以查看微软的MSDN,如果你英文还可以的话