Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX/Browser interaction

Status
Not open for further replies.

TheObserver

Programmer
Mar 26, 2002
91
US
Is there any possible way of modifying the text in IE's status bar from an ActiveX control embedded in a page loaded in that same IE window?

Basically I'd like to use the status bar to output machine state messages from an ActiveX control as it goes through its functionality.
 
Raise events with your ActiveX control. Your HTML page can then be notified. Have a public event method within your ActiveX control. Raise the event at any point within your control to notify the HTML page.

Sample code overview for your control below:

Public Event onUpdateStatus(ByVal Status As String)

Public Function PerformAction()
RaiseEvent onUpdateStatus("Start PerformAction")

Call DoBusinessRules()

RaiseEvent onUpdateStatus("End PerformAction")
End Function

Private Sub DoBusinessRules()
RaiseEvent onUpdateStatus("Start DoBusinessRules")
Do some actions
RaiseEvent onUpdateStatus("Stage 1 Complete")
Do some more actions
RaiseEvent onUpdateStatus("Stage 2 Complete")
...
...
RaiseEvent onUpdateStatus("End DoBusinessRules")
End Function

On the HTML page you have the object tag:

<OBJECT id=YourControl
codeBase=/setup/cabs/YourControl.CAB#version=1,0,0,1
classid=&quot;CLSID:42E4E651-6847-4AA1-9B65-27AB39F3B40C&quot; </OBJECT>

Finally, sample script code to handle the bubbled event:

<Script .....>
Sub Window_OnLoad()
Call YourControl.PerformAction()
End Sub

Sub YourControl_onUpdateStatus(CurrentStatus)
window.status = CurrentStatus
End Sub
</Script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top