- Код: Выделить всё
Dim lHandle As Long
lHandle = GetHandle(ie)
MsgBox lHandle
- Код: Выделить всё
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function EnumChildWindows Lib "user32" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Private lngWebHandle As Long
Public Function GetHandle(ByVal WebControl As WebBrowser) As Long
lngWebHandle = 0
EnumChildWindows WebControl.Parent.hWnd, AddressOf EnumChildProc, ByVal 0&
GetHandle = lngWebHandle
End Function
Private Function EnumChildProc(ByVal hWnd As Long, ByVal lParam As Long) As Long
Dim lngReturnValue As Long, strClassName As String
strClassName = Space(256)
lngReturnValue = GetClassName(hWnd, strClassName, 256)
If Left$(strClassName, lngReturnValue) = "Internet Explorer_Server" Then
lngWebHandle = hWnd
End If
EnumChildProc = 1
End Function
[Хакер] :: Впредь оформляй код тегами [cоde] ... [/code] или [syntаx="vb"] ... [/syntаx] !