限制鼠标在指定窗口手柄上的移动 [英] Restrict mouse movement over a specified window handle

查看:129
本文介绍了限制鼠标在指定窗口手柄上的移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在Windows上模拟Safari的信息亭模式. OSX无法与我的输入硬件配合使用,并且Chrome的GPU加速对于我正在使用的计算机而言太慢了.

I'm looking to simulate a kiosk mode for Safari on Windows. OSX will not work with my input hardware and Chrome's GPU acceleration is too slow for the machine I'm using.

到目前为止,唯一可行的解​​决方案是运行Safari并发送F11(全屏)按键,但是当鼠标到达屏幕顶部像素时,阻止URL栏扩展.

The only plausible solution [so far] is to run Safari and send an F11 (fullscreen) keystroke, but prevent the URL bar from expanding when the mouse reaches the top pixels of the screen.

我已经看过了,似乎找不到任何好的解决方案,想知道我是否可以限制光标移动到屏幕的顶部像素?

I've looked and can't seem to find any good solution and would like to know if I can restrict the cursor movement from reaching the top pixel of the screen?

如果有人有其他解决方案,那就太好了!

If anyone has any other solutions, that would be great!

推荐答案

您可以使用 ClipCursor 函数来执行此操作.

You can use the ClipCursor function to do this.

将光标限制在屏幕上的矩形区域.如果后续光标位置(由 SetCursorPos 函数或鼠标设置)位于矩形外部,则系统会自动调整位置以将光标保持在矩形区域内.

Confines the cursor to a rectangular area on the screen. If a subsequent cursor position (set by the SetCursorPos function or the mouse) lies outside the rectangle, the system automatically adjusts the position to keep the cursor inside the rectangular area.

这篇关于限制鼠标在指定窗口手柄上的移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆