找回密码
 加入
搜索
查看: 2869|回复: 11

[AU3基础] 有没有人能告诉我:一个函数能快速切换鼠标左右键?

  [复制链接]
发表于 2010-6-17 15:27:26 | 显示全部楼层 |阅读模式
我的au3中controlClick原本用的全部是左键,今天把脚本换到同事机器上跑出现了搞笑的问题,他习惯用左手,而我们一般都是用右手,这样导致了我的脚本完全不能用了,请问有没有一个函数是切换鼠标左右键的?
 楼主| 发表于 2010-6-17 15:43:14 | 显示全部楼层
Run("CONTROL.EXE main.cpl @0")
Sleep(2000)
ControlClick("Mouse Properties","",101)
Sleep(2000)
Send("{ENTER}")
这个是我自己写的 可以实现左右键的切换但是会弹出面板来点击,能不能静默切换?点击exe后左右键直接就换了,可不可以?

等待中。。。。。。
 楼主| 发表于 2010-6-17 16:03:29 | 显示全部楼层
Run("CONTROL.EXE main.cpl @0")
Sleep(2000)
ControlClick("","",101)
Sleep(2000)
Send("{ENTER}")
发表于 2010-6-18 20:59:04 | 显示全部楼层
寒, 用一个api 就可以啊
SwapMouseButton


SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP,TRUE,NULL,SPIF_UPDATEINIFILE|SPIF_SENDCHANGE);
发表于 2010-6-20 17:24:48 | 显示全部楼层
你可以设置个复选框,选上就是左手,不选就是右手,这样可扩展性能好点。
 楼主| 发表于 2010-6-21 12:30:41 | 显示全部楼层
回复 4# kylinpoet


    能不能再详细点?我看了下 但是不会用
 楼主| 发表于 2010-6-21 12:30:58 | 显示全部楼层
寒, 用一个api 就可以啊
SwapMouseButton


SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP,TRUE,NUL ...
kylinpoet 发表于 2010-6-18 20:59



   

; #FUNCTION# ====================================================================================================================
; Name...........: _WinAPI_SystemParametersInfo
; Description ...: Retrieves or sets the value of one of the system-wide parameters
; Syntax.........: _WinAPI_SystemParametersInfo($iAction[, $iParam = 0[, $vParam = 0[, $iWinIni = 0]]])
; Parameters ....: $iAction     - The system-wide parameter to be retrieved or set
;                  $iParam      - A parameter whose usage and format depends on the parameter being queried or set
;                  $vParam      - A parameter whose usage and format depends on the parameter being queried or set
;                  $iWinIni      - If a system parameter is being set, specifies whether the user profile is to be  updated,  and
;                  +if so, whether the $WM_SETTINGCHANGE message is to be broadcast. This parameter can be zero if you don't want
;                  +to update the user profile or it can be one or more of the following values:
;                  |$SPIF_UPDATEINIFILE - Writes the new setting to the user profile
;                  |$SPIF_SENDCHANGE    - Broadcasts the $WM_SETTINGCHANGE message after updating the user profile
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........; @@MsdnLink@@ SystemParametersInfo
; Example .......;
; ===============================================================================================================================
Func _WinAPI_SystemParametersInfo($iAction, $iParam = 0, $vParam = 0, $iWinIni = 0)
        Local $aResult

        $aResult = DllCall("user32.dll", "int", "SystemParametersInfo", "int", $iAction, "int", $iParam, "int", $vParam, "int", $iWinIni)
        If @error Then Return SetError(@error, 0, False)
        Return $aResult[0] <> 0
EndFunc   ;==>_WinAPI_SystemParametersInfo
 楼主| 发表于 2010-6-21 12:33:33 | 显示全部楼层
SwapMouseButton这个函数没找到 也不知道到底怎么用的
 楼主| 发表于 2010-6-21 12:34:03 | 显示全部楼层
SwapMouseButton 这个函数没找到 也不知道到底怎么用的 谢谢了
发表于 2010-6-21 15:53:06 | 显示全部楼层
回复 9# yarsye
是系统 dll啊 不是 udf
发表于 2010-6-22 14:30:58 | 显示全部楼层
回复 10# kylinpoet

用dllcall?试了不行
    能详细点吗?
 楼主| 发表于 2010-6-23 12:56:50 | 显示全部楼层
还在研究中
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-22 03:40 , Processed in 0.080115 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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