Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我看了看,除了 3rd 方程序之外找不到任何方法。但是有什么方法可以通过代码(C++)阻止光标移动到窗口边界之外?我在 Windows 上有一个 FPS 游戏项目,但显然在窗口模式下,鼠标可以移动到窗口外,这可能会导致问题。
试试 ClipCursor:
CRect rect; GetWindowRect(&rect); ClipCursor(&rect);
记得释放 che 光标ClipCursor(NULL);
ClipCursor(NULL);