vc++编程代码出错!那位大侠帮忙哈!初学,不知道错在哪里?

#include<windows.h>#include<stdio.h>LRESULTCALLBACKWinSunProc(HWNDhwnd,UINTuMsg,WPARA... #include<windows.h>
#include<stdio.h>
LRESULT CALLBACK WinSunProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam);

int WINAPI WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPWSTR lpCmdLine,
int nShowCmd
)
{
WNDCLASS wndcls;
wndcls.cbWndExtra=0;
wndcls.cbClsExtra=0;
wndcls.hbrBackground=(HBRUSH)GetStockObject(BLACK_BRUSH);
wndcls.hCursor=LoadCursor(NULL,IDC_CROSS);
wndcls.hIcon=LoadIcon(NULL,IDI_ERROR);
wndcls.hInstance=hInstance;
wndcls.lpfnWndProc=WinSunProc;
wndcls.lpszClassName="111111";
wndcls.lpszMenuName=NULL;
wndcls.style=CS_HREDRAW | CS_VREDRAW;
RegisterClass(&wndcls);
HWND hwnd;
hwnd=CreateWindow("111111","0000000000",WS_OVERLAPPEDWINDOW,0,0,800,600,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 WinSunProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
{
switch(uMsg)
{
case WM_CHAR:
char szChar[20];
sprintf(szChar,"char is %d",wParam);
MessageBox(hwnd,szChar,"222",0);
break;
case WM_LBUTTONDOWN:
MessageBox(hwnd,"mouse clicked","222",0);
HDC hdc;
hdc=GetDC(hwnd);
TextOut(hdc,0,50,"333",strlen("333"));
ReleaseDC(hwnd,hdc);
break;
case WM_PAINT:
HDC hDC;
PAINTSTRUCT ps;
hDC=BeginPaint(hwnd,&ps);
TextOut(hDC,0,0,"444",strlen("444"));
EndPaint(hwnd,&ps);
break;
case WM_CLOSE:
if(IDYES==MessageBox(hwnd,"是否结束?","222",MB_YESNO))
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default :
return DefWindowProc(hwnd,uMsg,wParam,lParam);
}
return 0;
}
展开
 我来答
yuxiao1121
2012-04-07 · TA获得超过130个赞
知道小有建树答主
回答量:132
采纳率:100%
帮助的人:141万
展开全部
int WINAPI WinMain改用其他函数名
LRESULT CALLBACK WinSunProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
后面的“;”号去掉
TextOut(hdc,0,50,"333",strlen("333"));
TextOut(hDC,0,0,"444",strlen("444"));
这两句中的“,”改为在英文状态下输入
追问
int WINAPI WinMain改用其他函数名
怎么改啊!请指教!我是新手!麻烦了,呵呵!
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式