求助,calldll FindwindowExW的使用方法
看了calldll函数,感觉没理解其中的原理。想findwindowExW来获mumu模拟器下的子句柄,但是怎么写返回值都是0x0要么就是无返回值。使用findwindowW获取父句柄倒是没问题。求大佬详细解释一下calldll的用法,以及findwindowexw的用法。 #Include <WinAPI.au3>Run('Au3Info.exe')
WinWait('')
Local $hAu3info = _WinAPI_FindWindow('Au3Info', '(暂停中)AutoIt v3 窗口信息工具')
ConsoleWrite($hAu3info&@CRLF)
$hAu3info = FindWindowExW($hAu3info,0,'Edit','')
ConsoleWrite($hAu3info&@CRLF)
Func FindWindowExW($hWndParent, $hWndChildAfter, $lpszClass, $lpszWindow)
Local $aResult = DllCall("user32.dll", "HWND", "FindWindowExW", "HWND", $hWndParent, "HWND", $hWndChildAfter, "wstr", $lpszClass, "wstr", $lpszWindow)
If Not @error Then Return $aResult
Return 0
EndFunc ;==>FindWindowExW WinGetHandle('')
这样试试 $aDllCallReturn = DllCall("user32.dll","HWND","FindWindowExW","HWND","0x000000000077025A","HWND","0","wstr","canvasWin","wstr","0")
If @error Then
Switch @error
Case 1
ConsoleWrite("DllCall错误(user32.dll/FindWindowExW): 不能使用DLL文件,可能使用参数有问题。" & @CRLF)
Case 2
ConsoleWrite("DllCall错误(user32.dll/FindWindowExW): 未知的返回值类型." & @CRLF)
Case 3
ConsoleWrite("DllCall错误(user32.dll/FindWindowExW): 函数未包含在DLL文件中。函数名称是区分大小写的哦!" & @CRLF)
Case 4
ConsoleWrite("DllCall错误(user32.dll/FindWindowExW): 参数数量错误!" & @CRLF)
Case 5
ConsoleWrite("DllCall错误(user32.dll/FindWindowExW): 错误的参数!" & @CRLF)
Case Else
ConsoleWrite("DllCall错误(user32.dll/FindWindowExW): 未知/不可预期的错误!" & @CRLF)
EndSwitch
$vDllCallReturn = ""
Else
$vDllCallReturn = $aDllCallReturn
ConsoleWrite("DllCall 返回值: " & $vDllCallReturn & @CRLF)
EndIf
高深,DLLCALL完全不懂 这个可以识别非标准控件吗
页:
[1]