2023年7月9日发(作者:)
3函数之——ControlClick例⼦: 打开⼀个记事本,名字为、练习,修改内容WinActivate("练习") ;以下为通过菜单打开退出选项 Sleep(800) Send("!f") Sleep(800) Send("x") ;由于标题不同,这⾥需要注意,ControlClick的第三个参数是按钮的⽂本显⽰ ControlClick("记事本","","取消")
;此处为点击右键操作 ControlClick("","","","right")ControlClick详细介绍:Sends a mouse click command to a given lClick ( "title", "text", controlID [, button [, clicks [, x [, y ]]]] )
ParameterstitletextcontrolIDThe title of the window to text of the window to control to interact with. See .[optional] The button to click, "left", "right", "middle", "main", "menu", "primary", "secondary". Default is the leftbutton.[optional] The number of times to click the mouse. Default is 1.[optional] The x position to click within the control. Default is center.[optional] The y position to click within the control. Default is clicksxy
Return ValueSuccess:Failure:Returns s 0.
RemarksSome controls will resist clicking unless they are the active window. Use the WinActivate() function to force the control'swindow to the top before using ControlClick().
Using 2 for the number of clicks will send a double-click message to the control - this can even be used to launch programsfrom an explorer control! If the user has swapped the left and right mouse buttons in the control panel, then the behaviour of the buttons is different."Left" and "right" always click those buttons, whether the buttons are swapped or not. The "primary" or "main" button will bethe main click, whether or not the buttons are swapped. The "secondary" or "menu" buttons will usually bring up the contextmenu, whether the buttons are swapped or not.
Button"""left""middle""right""primary""main""secondary""menu"NormalLeftLeftMiddleRightLeftLeftRightRightSwappedLeftLeftMiddleRightRightRightLeftLeft
发布者:admin,转转请注明出处:http://www.yc00.com/xiaochengxu/1688897908a181934.html
评论列表(0条)