Results 1 to 2 of 2

Thread: Detect When ActiveX control is loaded on the webpage?

  1. #1

    Thread Starter
    Lively Member Ceri's Avatar
    Join Date
    Sep 2000
    Posts
    72

    Detect When ActiveX control is loaded on the webpage?

    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

  2. #2
    jim mcnamara
    Guest
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width