找回密码
 加入
搜索
查看: 1872|回复: 2

[AU3基础] 判断鼠标是否移动过(已解决)

[复制链接]
发表于 2010-8-2 18:15:04 | 显示全部楼层 |阅读模式
本帖最后由 lin0308 于 2010-8-4 14:39 编辑

没动返回一个数值,动了也返回一个数值
只监控鼠标,
发表于 2010-8-2 18:27:00 | 显示全部楼层
本帖最后由 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[0]&","&$pos1[1])
$pos2 = MouseGetPos()
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
$pos1 = MouseGetPos()
if $pos1[0] <> $pos2[0] or $pos1[1] <> $pos2[1] then GUICtrlSetData($Label1,"当前鼠标位置:"&$pos1[0]&","&$pos1[1])
$pos2 = MouseGetPos()
WEnd

评分

参与人数 1金钱 +20 收起 理由
afan + 20

查看全部评分

发表于 2010-8-3 18:03:22 | 显示全部楼层
不错 学习了~
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-3 12:29 , Processed in 0.073102 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表