FindWindowEX无法正确获取子窗口的句杯
以下是vb .net 的代码:
Public Class Form1
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim lngHwnd As Long
Dim lngCHwnd As Long
lngHwnd = FindWindow(vbNullString, "Browser")
lngCHwnd = FindWindowEx(lngHwnd, 0, "Internet Explorer_Server", vbNullString)
Debug.WriteLine(lngHwnd & "---" & lngCHwnd)
End Sub
End Class
lngHwnd = FindWindow(vbNullString, "Browser")
lngCHwnd = FindWindowEx(lngHwnd, 0,vbNullString,"Internet Explorer_Server")