5.1 鼠标管理

a). MouseClick 点击鼠标

MouseClick ( "button" [, x, y [, clicks = 1 [, speed = 10]]] )
示例:MouseClick($MOUSE_CLICK_LEFT)
The button to click: Constants are defined in "AutoItConstants.au3".
$MOUSE_CLICK_LEFT ("left")
$MOUSE_CLICK_RIGHT ("right")
$MOUSE_CLICK_MIDDLE ("middle")
$MOUSE_CLICK_MAIN ("main")
$MOUSE_CLICK_MENU ("menu")
$MOUSE_CLICK_PRIMARY ("primary")
$MOUSE_CLICK_SECONDARY ("secondary") speed 1(fastest)~100(slowest)

b). MouseClickDrag //按下鼠标并拖动

//注:到目的地后会松开,登陆滑块需要使用keydown/keyup
MouseClickDrag ( "button", x1, y1, x2, y2 [, speed = 10] ) 示例:MouseClickDrag($MOUSE_CLICK_LEFT, 0, 200, 600, 700)
button
The button to click: Constants are defined in "AutoItConstants.au3".
$MOUSE_CLICK_RIGHT ("right")
$MOUSE_CLICK_MIDDLE ("middle")
$MOUSE_CLICK_MAIN ("main")
$MOUSE_CLICK_MENU ("menu")
$MOUSE_CLICK_PRIMARY ("primary")
$MOUSE_CLICK_SECONDARY ("secondary")
x1, y1 The x/y coords to start the drag operation from.
x2, y2 The x/y coords to end the drag operation at.
speed 1(fastest)~100(slowest)

c). MouseDown MouseDown ( "button" ) //当前位置按下鼠标

示例:	MouseDown($MOUSE_CLICK_LEFT) ; Set the left mouse button state as down.
Sleep(100)
MouseUp($MOUSE_CLICK_LEFT) ; Set the left mouse button state as up.
The button to click: Constants are defined in "AutoItConstants.au3".
$MOUSE_CLICK_RIGHT ("right")
$MOUSE_CLICK_MIDDLE ("middle")
$MOUSE_CLICK_MAIN ("main")
$MOUSE_CLICK_MENU ("menu")
$MOUSE_CLICK_PRIMARY ("primary")
$MOUSE_CLICK_SECONDARY ("secondary")

d). MouseUp ( "button" ) //松开指定鼠标键

e). MouseGetPos MouseGetPos ( [dimension] ) //当前鼠标位置,返回数组,X/Y坐标

Local $aPos = MouseGetPos()

f). MouseMove MouseMove ( x, y [, speed = 10] ) //移动鼠标

示例:MouseMove(700, 700, 0) ;
speed 1(fastest)~100(slowest)

g). MouseWheel MouseWheel ( "direction" [, clicks = 1] ) //滑动鼠标滚轮

示例:MouseWheel($MOUSE_WHEEL_UP, 10)
The direction to move the wheel: Constants are defined in "AutoItConstants.au3".
$MOUSE_WHEEL_UP ("up")
$MOUSE_WHEEL_DOWN ("down")
clicks [optional] The number of times to move the wheel. Default is 1.

5.2 windows窗口管理

a). WinActivate ( "title" [, "text"] ); //激活指定窗口(焦点)

b). WinActive ( "title" [, "text"] ) //窗口是否存在,且激活状态

c). WinClose ( "title" [, "text"] ) //关闭窗口

d). WinExists ( "title" [, "text"] ) //窗口是否存在

e). WinGetHandle ( "title" [, "text"] ) //获取窗口句柄

f). WinGetProcess ( "title" [, "text"] ) //窗口对应的进程Id

g). WinGetState ( "title" [, "text"] ) //窗口状态

返回值:
Success: a value indicating the state of the window. Multiple values are added together so use BitAND() to examine the part you are interested in:
$WIN_STATE_EXISTS (1) = Window exists
$WIN_STATE_VISIBLE (2) = Window is visible
$WIN_STATE_ENABLED (4) = Window is enabled
$WIN_STATE_ACTIVE (8) = Window is active
$WIN_STATE_MINIMIZED (16) = Window is minimized
$WIN_STATE_MAXIMIZED (32) = Window is maximized
Failure: 0 and sets the @error flag to non-zero if the window is not found.
//示例代码
Local $iState = WinGetState($hWnd)
; Check if the Notepad window is minimized and display the appropriate message box.
If BitAND($iState, 16) Then

h). WinKill ( "title" [, "text"] ) //强制关闭

i). WinList ( ["title" [, "text"]] ) //已打开的窗口列表

j). WinWait ( "title" [, "text" [, timeout = 0]] ) //等待直到指定窗口出现

	返回值:
The array returned is two-dimensional and is made up as follows:
$aArray[0][0] = Number of windows returned
$aArray[1][0] = 1st window title
$aArray[1][1] = 1st window handle (HWND)
$aArray[2][0] = 2nd window title
$aArray[2][1] = 2nd window handle (HWND)
//示例-展示所有窗口
#include <MsgBoxConstants.au3>
Example()
Func Example()
; Retrieve a list of window handles.
Local $aList = WinList() ; Loop through the array displaying only visable windows with a title.
For $i = 1 To $aList[0][0]
If $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 2) Then
MsgBox($MB_SYSTEMMODAL, "", "Title: " & $aList[$i][0] & @CRLF & "Handle: " & $aList[$i][1])
EndIf
Next
EndFunc

k). WinWaitActive ( "title" [, "text" [, timeout = 0]] ) //等待直到指定窗口激活

l). WinWaitClose ( "title" [, "text" [, timeout = 0]] ) //等待直到指定窗口不存在

m). WinWaitNotActive ( "title" [, "text" [, timeout = 0]] ) //等待直到指定窗口非激活状态

n). WinSetState ( "title", "text", flag ) //设置窗口状态,显示,隐藏,最大化,最小化等

示例代码: WinSetState($hWnd, "", @SW_HIDE)
The "show" flag of the executed program:
@SW_HIDE = Hide window
@SW_SHOW = Shows a previously hidden window
@SW_MINIMIZE = Minimize window
@SW_MAXIMIZE = Maximize window
@SW_RESTORE = Undoes a window minimization or maximization
@SW_DISABLE = Disables the window
@SW_ENABLE = Enables the window

5 - 参考函数-API的更多相关文章

  1. 065 updateStateByKey的函数API

    一:使用场景 1.应用场景 数据的累加 一段时间内的数据的累加 2.说明 每个批次都输出自己批次的数据, 这个时候,可以使用这个API,使得他们之间产生联系. 3.说明2 在累加器的时候,起到的效果和 ...

  2. HTML5 Audio标签方法和函数API介绍

    问说网 > 文章教程 > 网页制作 > HTML5 Audio标签方法和函数API介绍 Audio APIHTML5HTML5 Audio预加载 HTML5 Audio标签方法和函数 ...

  3. MySQL Crash Course #05# Chapter 9. 10. 11. 12 正则.函数. API

    索引 正则表达式:MySQL only supports a small subset of what is supported in most regular expression implemen ...

  4. Unix/Linux系统时间函数API

    首先说明关于几个时间的概念: 世界时:起初,国际上的标准时间是格林尼治标准时间,以太阳横穿本初子午线的时刻为标准时间正午12点.它根据天文环境来定义,就像古代人们根据日晷来计时一样,如下图: 原子时: ...

  5. Atitit.跨平台预定义函数 魔术方法 魔术函数 钩子函数 api兼容性草案 v2 q216  java c# php js.docx

    Atitit.跨平台预定义函数 魔术方法 魔术函数 钩子函数 api兼容性草案 v2 q216  java c# php js.docx 1.1. 预定义函数 魔术方法 魔术函数是什么1 1.2. & ...

  6. kotlin函数api

    原 Kotlin学习(4)Lambda 2017年09月26日 21:00:03 gwt0425 阅读数:551   记住Lambda的本质,还是一个对象.和JS,Python等不同的是,Kotlin ...

  7. 一个简单可参考的API网关架构设计

    网关一词较早出现在网络设备里面,比如两个相互独立的局域网段之间通过路由器或者桥接设备进行通信, 这中间的路由或者桥接设备我们称之为网关. 相应的 API 网关将各系统对外暴露的服务聚合起来,所有要调用 ...

  8. jQuery函数API,各版本新特性汇总

    jQuery API 速查表 选择器 基本 #id element .class * selector1,selector2,selectorN 层级 ancestor descendant pare ...

  9. Azure 静态 web 应用集成 Azure 函数 API

    前几次我们演示了如果通过Azure静态web应用功能发布vue跟blazor的项目.但是一个真正的web应用,总是免不了需要后台api服务为前端提供数据或者处理数据的能力.同样前面我们也介绍了Azur ...

随机推荐

  1. Python-RabbitMQ消息队列的发布与订阅

    RabbitMQ消息队列的发布与订阅类似于广播,一端发送消息,多个客户端可以同时接收到消息 fanout:所有绑定到exchange的queue都可以接收消息 消息发布端 # -*- coding:u ...

  2. 关于 sklearn.decomposition.KernelPCA的简单介绍

    from sklearn import decomposition import numpy as np A1_mean = [1, 1] A1_cov = [[2, .99], [1, 1]] A1 ...

  3. 网站跳转到Apache 2 Test Page powered by CentOS

    原来是80端口被占用的问题 解决80端口占用问题 sudo fuser -n tcp -k 覆盖原来的httpd cp /usr/local/apache2/bin/apachectl /etc/in ...

  4. Tomcat 服务器详解

    工具/原料 1.JDK:版本为jdk-7-windows-i586.exe  下载地址   http://www.oracle.com/technetwork/java/javase/download ...

  5. 韩顺平循序渐进学JAVA从入门到精通 视频全套,需要的联系我

    0讲-开山篇.avi 10讲-访问修饰符.重载.覆盖.avi 11讲-约瑟夫问题.avi 12讲-多态.avi 13讲-抽象类.接口.avi 14讲-final.作业评讲.avi 15讲-作业.测试题 ...

  6. Shrio00 Shiro认证登录、权限管理环境搭建

    基础环境准备: JDK -> java version "1.8.0_101" MAVEN -> Apache Maven 3.5.0 1 导入依赖 mysql驱动 m ...

  7. 做c语言的码农专业发展方向

    写了几年C语言代码,最近在思索,何去何从比较好? 搜索了一下,发现几个答案: 2015年10月编程语言排行榜 丢开C语言在教学应用外.在目前C语言的实际应用中.常见的应用的情景有如下: 内核/驱动,b ...

  8. SQL语言 持续更新中……

    SQL提供了很多的聚集函数  COUNT([DISTINCT\ALL]*) SUM([DISTINCT\ALL]<列名>)AVG().…… WHERE 子句中是不能用聚集函数作为条件表达式 ...

  9. SCUT - 337 - 岩殿居蟹 - 线段树 - 树状数组

    https://scut.online/p/337 这个东西是个阶梯状的.那么可以考虑存两棵树,一棵树是阶梯的,另一棵树的平的,随便一减就是需要的阶梯. 优化之后貌似速度比树状数组还惊人. #incl ...

  10. 在xcode中设置include和lib路径

    最近刚刚开始玩xcode,对着教程学编程时很少要动到项目设置,但昨天晚上想使用freetype验证上篇博文的问题,就需要设置include和lib路径了. 首先我下了freetype的源码,并在本地编 ...