RECT rcClip; // new area for ClipCursor RECT rcOldClip; // previous area for ClipCursor
// Get the dimensions of the application's window. GetWindowRect(&rcClip); // Confine the cursor to the application's window. ClipCursor(&rcClip); 这段c++代码可以把鼠标锁定在当前窗口所在的区域内。
只是做过 屏蔽一些键 利用hook
钩子函数
不过对于全局hook要vc
http://dev.hackbase.com/hackbase34/how531078.htm
RECT rcOldClip; // previous area for ClipCursor
// Get the dimensions of the application's window.
GetWindowRect(&rcClip);
// Confine the cursor to the application's window.
ClipCursor(&rcClip);
这段c++代码可以把鼠标锁定在当前窗口所在的区域内。