本帖最后由 cashiba 于 2016-4-15 19:49 编辑 #include <AutoItConstants.au3>
#include <Array.au3>
#include <WinAPISys.au3>
#include <WinAPI.au3>
Opt("WinTitleMatchMode", 1)
run("notepad.exe")
Local $hwnd1=WinActivate("无标题 - 记事本");这句为啥取不到句柄?
ConsoleWrite("$hwnd1=" & $hwnd1 & @CRLF)
Local $hwnd2 = WinWait("[CLASS:Notepad]", "", 10)
ConsoleWrite("$hwnd2=" & $hwnd2 & @CRLF)
WinActivate($hwnd2)
Sleep(1500)
Local $hwnd3= WinActive("[CLASS:Notepad]")
ConsoleWrite("$hwnd3=" & $hwnd3 & @CRLF)
If $hwnd3 Then $aData = _WinAPI_EnumChildWindows($hwnd3)
_ArrayDisplay($aData, 'Note_ChildWindows')
Sleep(1500)
Local $hwnd4=WinActivate("Note_ChildWindows");这句为啥取不到句柄?
ConsoleWrite("Note_ChildWindows的句柄=" & $hwnd4 & @CRLF)
Local $hwnd5=WinActivate("class:AutoIt v3 GUI]");这句为啥取不到句柄?
ConsoleWrite("Note_ChildWindows的句柄=" & $hwnd5 & @CRLF)
Sleep(1500)
WinClose($hwnd4)
Sleep(1500)
WinClose($hwnd2)
小白,今天木事,练习一下几个窗口函数,发现不尽人意,发上来请大侠们提点提点,看看是哪里没有理解透彻,先行感谢了...... |