Solved

how to externally trigger browser event?

Posted on 2000-03-23
3
136 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 150 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 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