判断鼠标是否移动过(已解决)
本帖最后由 lin0308 于 2010-8-4 14:39 编辑没动返回一个数值,动了也返回一个数值
只监控鼠标, 本帖最后由 xsjtxy 于 2010-8-2 18:28 编辑
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("", 150, 15, -1, 0,$WS_POPUP)
$Label1 = GUICtrlCreateLabel("", 1, 1, 200, 17)
GUISetState(@SW_SHOW)
$pos1 = MouseGetPos()
GUICtrlSetData($Label1,"当前鼠标位置:"&$pos1&","&$pos1)
$pos2 = MouseGetPos()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
$pos1 = MouseGetPos()
if $pos1 <> $pos2 or $pos1 <> $pos2 then GUICtrlSetData($Label1,"当前鼠标位置:"&$pos1&","&$pos1)
$pos2 = MouseGetPos()
WEnd 不错 学习了~
页:
[1]