?
Solved

how to externally trigger browser event?

Posted on 2000-03-23
3
Medium Priority
?
137 Views
Last Modified: 2011-08-18
Can anyone tell me how to trigger an event in an IE 5.0 document from an external application?  I would be happy to trigger an event of my own creation.  
I am writing an IE 5.0 application that needs to communicate with another (non-IE) application.  The non-IE app needs to be able to tell the IE app to update itself.
I had thought that I would use the on-focus event, but for very complicated reasons, I am not allowed to do so, so I would like to trigger an event in the browser that I can put some code behind so that it can update itself.
Can anyone tell me how to do this?
0
Comment
Question by:Jodi_k
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 28

Accepted Solution

by:
Ark earned 600 total points
ID: 2652072
Hi
Assume, you know IE window handle. In this case
Private Declare Function SetFocus Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const VK_F5 = &H74
Private Const KEYEVENTF_KEYUP = &H2


Private Sub Command1_Click()
' or SetFiregroundWindow IEhWnd
  SetFocus IEhWnd
  keybd_event VK_F5, 0, 0, 0
  keybd_event VK_F5, 0, KEYEVENTF_KEYUP, 0
End Sub

Cheers
0
 
LVL 6

Expert Comment

by:VBGuru
ID: 2652619
'add reference to microsoft internet controls and open the explorer by running this application
'If you want to refresh the content. click on the form, it will refresh.
Option Explicit
Dim i As InternetExplorer

Private Sub Form_Click()
i.Navigate2 "www.microsoft.com"
End Sub

Private Sub Form_Load()
Set i = New InternetExplorer
i.Navigate2 "www.microsoft.com"
i.Visible = True
End Sub
0
 

Author Comment

by:Jodi_k
ID: 2655855
Thanks very much, this was exactly what I needed!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question