Solved

Extracting Internet Explorer session information from VB

Posted on 2003-10-23
3
270 Views
Last Modified: 2013-12-26
Hi Experts!!!

Just wondering if anyone has any idea of the best way to
1. check if Internet explorer is running from VB (v.6) - I've looked up the environment variables and there isn't an obvious way to check processes to see if "IEXPLORE.EXE" is running.
2. if IE is running, I want to extract the URL to find out where the user is.
3. If IE is NOT running, I want to trigger a new IE session. - I have had a play with the Internet explorer object available in VB, but I need users to toggle between the VB form, and enter info while looking at the explorer window. This object appears to only allow users access to one or the other, not both at the same time.
4. I also want to send users to a particular URL.

It sounds like such a simple process!!! But I have no idea how to go about it...

Thanks for your help!

0
Comment
Question by:tio717
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
TheQuestion earned 400 total points
ID: 9606284
Code for Seeing if Ie is running :

 http://www.freevbcode.com/ShowCode.ASP?SearchString=dfreeze&ID=3561

To launch if not there:

Private Declare Function ShellExecute Lib _
"shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long

Private Sub URL_Click()

Dim iret As Long

' open URL into the default internet browser

iret = ShellExecute(Me.hwnd, vbNullString, _
"http://www.microsoft.com", vbNullString, _
"c:\", SW_SHOWNORMAL)

End Sub


and im currently searching for the extraction
0
 
LVL 3

Expert Comment

by:TheQuestion
ID: 9606299
0
 

Author Comment

by:tio717
ID: 9661504
That little function listed above is so effective! It actually checks if explorer is running, if it is, launches the appropriate URL, and if not, launches a new session! I can't believe how easy that was!

Thankyou!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now