找回密码
 加入
搜索
查看: 3963|回复: 8

[GUI管理] [已解决]$hwnd = WinGetHandle('classname=Progman')是获取整个桌面的句柄?

  [复制链接]
发表于 2011-9-22 10:28:46 | 显示全部楼层 |阅读模式
本帖最后由 pdp320921 于 2011-9-22 18:47 编辑

问题如题

$hwnd = WinGetHandle('classname=Progman')中获取整个桌面的句柄?
我想知道在帮助文件哪里可以查询?
恳请大侠指点下~
发表于 2011-9-22 10:38:46 | 显示全部楼层
本地的帮助打开scite,按F1就行了。

在线帮助文档在这里,上边的导航条选doc就行了。
http://autoitx.com/Doc/

函数参考

WinGetHandle
获取指定窗口的内部句柄.

WinGetHandle ( "窗口标题" [, "窗口文本"] )


参数

窗口标题        目标窗口标题. 参考标题特殊定义
窗口文本         [可选参数] 目标窗口文本.


返回值

成功:        返回一个含有目标窗口句柄的字符串.
失败:        返回一个""(空字符串),并把 @error 设为 1,说明不存在符合匹配要求的窗口.


注意/说明

这个函数允许你使用"窗口标题"和"窗口文本"得到窗口的句柄.
一旦您成功取得了窗口句柄,即使以后窗口标题发生了变化,还是可以使用这个句柄来进行窗口操作.
 楼主| 发表于 2011-9-22 14:00:38 | 显示全部楼层
回复 2# zhangchongzhi
'classname=Progman'代表什么意思?
我没讲清楚还是?
发表于 2011-9-22 14:53:23 | 显示全部楼层
本帖最后由 zsken 于 2011-9-22 14:57 编辑

应该这样写:
$hwnd = WinGetHandle("[Class:Progman;Title:Program Manager]")


Advanced Window Descriptions
A special description can be used as the window title parameter. This description can be used to identify a window by the following properties:

TITLE - Window title
CLASS - The internal window classname
REGEXPTITLE - Window title using a regular expression (if the regular expression is wrong @error will be set to 2)
REGEXPCLASS - Window classname using a regular expression (if the regular expression is wrong @error will be set to 2)
LAST - Last window used in a previous AutoIt command
ACTIVE - Currently active window
X \ Y \ W \ H - The position and size of a window
INSTANCE - The 1-based instance when all given properties match
 楼主| 发表于 2011-9-22 15:32:15 | 显示全部楼层
回复 4# zsken

看来还是没清楚我什么意思?
我只是想问'classname=Progman'如何得来的?
发表于 2011-9-22 16:38:26 | 显示全部楼层
用Au3Info工具取桌面信息,其中的类名就是Progman,“classname”意思就是类名。

评分

参与人数 1贡献 +1 收起 理由
pdp320921 + 1 感谢

查看全部评分

发表于 2011-9-22 16:43:21 | 显示全部楼层
简单的写法:
$hwnd = WinGetHandle("[Class:Progman]")
 楼主| 发表于 2011-9-22 18:46:47 | 显示全部楼层
回复 7# vuivui

了解了
我以为是
$hwnd = WinGetHandle("[Class:SysListView32]")
感激~!
发表于 2011-9-23 14:58:18 | 显示全部楼层
回复 3# pdp320921


    哎,我个笨蛋哎。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-17 08:01 , Processed in 0.082325 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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