我是一名刚学习VC++的新手,请大大们指点一二,万分感谢
洛丹伦之心 2009-05-04 11:20:05 这是我照着书打的一个现实鼠标实时位置的程序,结果无论如何都出问题,我附了代码和编译报告,请指点一二,谢谢
#include "stdafx.h"
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
MSG msg;
MyRegisterClass(hInstance);
if(!InitInstance(hInstance,nCmdShow))
{return FALSE;
}
while(GetMessage(&msg,NULL,0,0))
{TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam ;
}
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;
wcex.cbSize =sizeof(WNDCLASSEX);
wcex.style =CS_HREDRAW |CS_VREDRAW;
wcex.lpfnWndProc =(WNDPROC)WndProc;
wcex.cbClsExtra =0;
wcex.cbWndExtra =0;
wcex.hInstance =hInstance;
wcex.hIcon =LoadIcon(hInstance,(LPCTSTR)IDI_MOUSEMOVE);
wcex.hCursor =LoadCursor(NULL,IDC_ARROW);
wcex.hbrBackground =(HBRUSH)(COLOR_WINDOW+1);