本帖最后由 zps26 于 2010-9-18 22:57 编辑
#include <WinAPIEx.au3>
#include <WinAPI.au3>
Local $a,$HSEd1
$a = WinGetHandle("被监控的程序名称")
$HSEd1 = _WinAPI_GetDlgItem(_SMain(), 1032)
MsgBox(8192 + 64, "窗口句柄为", $HSEd1, 20)
Func _SMain()
Local $aWindows, $i, $text, $text1, $text2, $PHWnd
$aWindows = _WinAPI_EnumChildWindowS($a, 0) ;0为查找隐藏窗口
For $i = 1 To UBound($aWindows) - 1
$text = $aWindows[$i][0] ;Window Handle
$text1 = $aWindows[$i][1] ;Window Class
$text2 = WinGetTitle($aWindows[$i][0]) ;Window Title
If $text <> "" And $text1 = "Static" And $text2 = "控件标题" Then
$PHWnd = _WinAPI_GetParent($text)
Return $PHWnd ;返回查找控件父窗口句柄
ExitLoop
EndIf
Next
EndFunc ;==>_SMain
|