本帖最后由 zps26 于 2010-9-11 10:37 编辑 #include <WinAPIEx.au3>
#include <WinAPI.au3>
Local $a
$a = WinGetHandle("运行的程序名称")
MsgBox(8192 + 64, "运行程序的句柄为", $a, 10)
MsgBox(8192 + 64, "查找窗口句柄显示", "窗口句柄为:" & _Shwnd(), 10)
Func _Shwnd()
Local $aWindows, $i, $Ha, $Ca, $Ta
$aWindows = _WinAPI_EnumChildWindowS($a, 0) ;0为查找隐藏窗口
For $i = 1 To $aWindows[0][0] ;获取的程序子窗口总数
$Ha = $aWindows[$i][0] ;Window Handle
$Ca = $aWindows[$i][1] ;Window Class
$Ta = WinGetTitle($aWindows[$i][0]) ;Window Title
If IsHWnd($Ha) And $Ca = "TfrmAuditing" And $Ta = "" Then
Return $Ha ;返回查找的窗口句柄
ExitLoop
EndIf
Next
EndFunc ;==>_Shwnd
|