//得到exe路径
TCHAR exeFullPath[MAX_PATH];
CString strPath;
GetModuleFileName(NULL,exeFullPath,MAX_PATH);
strPath=(CString)exeFullPath;
int position=strPath.ReverseFind('\\');
strPath=strPath.Left(position+1);
//得到当前消息的ID号
GetCurrentMessage:
m_nIDColor = LOWORD(GetCurrentMessage()->wParam);
//得到当前的鼠标位置
const MSG* msg = GetCurrentMessage();
CPoint point( msg->pt );
ScreenToClient( &point );
CPoint point( msg->pt );
ScreenToClient( &point );
//得到程序模块名称,全路径也就是当前运行程序的全路径
TCHAR exeFullPath[MAX_PATH]; // MAX_PATH
GetModuleFileName(NULL,exeFullPath,MAX_PATH);
//限制鼠标范围
ClipCursor , ClipCursor(NULL)
//设置鼠标捕获
SetCapture ReleaseCapture
//防止窗口的闪烁
setredraw(FALSE); //禁止重画
setredraw(TRUE); //允许重画; 之后需要调用Invalidate成员函数以使窗口被重画.
//得到exe路径
TCHAR exeFullPath[MAX_PATH];
CString strPath;
GetModuleFileName(NULL,exeFullPath,MAX_PATH);
strPath=(CString)exeFullPath;
int position=strPath.ReverseFind('\\');
strPath=strPath.Left(position+1);
TCHAR exeFullPath[MAX_PATH];
CString strPath;
GetModuleFileName(NULL,exeFullPath,MAX_PATH);
strPath=(CString)exeFullPath;
int position=strPath.ReverseFind('\\');
strPath=strPath.Left(position+1);