
- Код: Выделить всё
MsgBox WebBrowser1.hWnd

- Код: Выделить всё
-2147467259 Method 'HWND' of object 'IWebBrowser2' failed
Почему

MsgBox WebBrowser1.hWnd
-2147467259 Method 'HWND' of object 'IWebBrowser2' failed
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, _
ByVal wCmd As Long) As Long
Option Explicit
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, _
ByVal wCmd As Long) As Long
Private Const GW_CHILD = 5
'---------------------------------------------------------------------------------
Public Function GetBrowserWindow(hwndBrowserContainer As Long) As Long
GetBrowserWindow = GetWindow(hwndBrowserContainer, GW_CHILD)
End Function
'---------------------------------------------------------------------------------
Private Sub Command1_Click()
MsgBox GetBrowserWindow(Picture1.hwnd)
End Sub
Сейчас этот форум просматривают: Google-бот, SemrushBot и гости: 3