How Can i detect when an activex control is finshed downloading and loaded on a webpage.
I tried onload event but it was fired before the activex control was loaded.
any help would be great
Printable View
How Can i detect when an activex control is finshed downloading and loaded on a webpage.
I tried onload event but it was fired before the activex control was loaded.
any help would be great
You can try to get information, almost anything, about the window using api. It will return an error until the form is loaded
All ActiveX controls have a hWnd property. Let's use that.
Code:Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds _ As Long)
Private Declare Function GetWindowRect Lib "user32" (ByVal _ hwnd As Long, lpRect As RECT) As Long
Dim Rec As RECT
' 0 means the call failed, the control isn't loaded.
' this loop will wait until the activeX control is up & going.
While GetWindowRect( ActiveXcontrol.hwnd, Rec) = 0
Sleep 5
DoEvents
Loop