易语言 如何将一个鼠标设备暂时禁用 我要的是弹出设备
以下是示例代码:
#include <WinAPI.au3>
; 获取鼠标句柄
Local $hMouse = _WinAPI_GetForegroundWindow()
; 禁用鼠标设备
_WinAPI_EnableWindow($hMouse, False)
; 弹出设备
MsgBox(0, "提示", "请点击确定继续")
; 恢复鼠标设备
_WinAPI_EnableWindow($hMouse, True)
代码中,使用了 WinAPI 库的 _WinAPI_GetForegroundWindow 函数获取当前活动窗口的句柄,即鼠标设备句柄。然后使用 _WinAPI_EnableWindow 函数禁用鼠标设备,弹出设备后再恢复鼠标设备。
原文地址: https://www.cveoy.top/t/topic/eO5m 著作权归作者所有。请勿转载和采集!