注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

chunwaihome 的博客

 
 
 

日志

 
 

Control(控件)  

2010-02-17 12:28:51|  分类: AutoIt |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

AutoIt的Control功能類似Powerpro的Child Window。

Almost everything you see on a window is a control of some kind: buttons(按钮), listboxes(列表框), edit fields(文本编辑框), static text(静态文本) are all controls.  In fact Notepad is just one big "Edit" control!  Because AutoIt works directly with a control they provide a more reliable way to automate than just sending keystrokes(模拟键击).

 

Note: AutoIt only works with standard Microsoft controls - some applications write their own custom controls which may look like a standard MS control but may resist automation. Experiment!

 

Information on controls is given by AutoIt Window Info Tool, these are:

  • Control ID
  • ClassNameNN
  • Text
  • Control Handle (HWND) (Not available in AutoIt Window Info Tool - see below)

  • Control ID(控件 ID)             類似Powerpro的Child Index

The Control ID is the internal numeric identifier 数值型标识符(实际上就是整数值) that windows gives to each control. It is generally the best method of indentifying controls.

 

  • ClassNameNN(类别名)

Each Microsoft standard control has a "classname" such as "button(按鈕)" or "edit(编辑框)".

In AutoIt this is combined with the "instance" of that control to give the "ClassNameNN" method. If you have a simple dialog with a few buttons on it they will generally be referred to as "Button1", "Button2", "Button3", etc. 

This method is useful when the Control ID is not applicable (for static text or custom controls).

 

  • Text(文本)

You will notice that AU3Info gives you the text it can see on a control, for example on a Next button you might see the text &Next - the & indicates that the next letter is underlined and is common when working with menus and controls. 

 

  • Control Handle (HWND) (控件句柄)

Using the ControlGetHandle function you can determine the Handle or HWND of a control.

 A handle is the unique indentifier that Windows gives controls.

Handle會隨著軟件的每次啟動而改變,所以當您啟動一個記事本並獲取其Handle值,但當您關閉它再次打開記事本時,它的Handle值而不是之前那個啦!

  评论这张
 
阅读(386)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017