Solved

Webbrowser Handle

Posted on 2008-10-03
5
435 Views
Last Modified: 2012-05-05
1.) How do i determine the default webBrowser?

2.) How can I determine if the Default webBrowser (Or any webbrowser for that matter) is active

3.) How can I get the handle of the browser?
0
Comment
Question by:geocoins-software
  • 3
  • 2
5 Comments
 
LVL 21

Expert Comment

by:ziolko
Comment Utility
1)
to get default browser you have to check registry:
go to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
and read "User Agent" value

alternatively you can check this key:
HKEY_CURRENT_USER\Software\Classes\http\shell\open\ddeexec\Application

2) what you mean active?

3) handle... you mean handle of window? (or should I ask all open windows)

ziolko.
0
 

Author Comment

by:geocoins-software
Comment Utility
>1.) and read "User Agent" value

what are the valid values?

>2) what you mean active?

Is the Default - webbowser open?  If not, is there a webbrowser opne?

>3) Handle of the webrowser window, so that I can enumerate the controls

thanks




0
 
LVL 21

Accepted Solution

by:
ziolko earned 500 total points
Comment Utility
1)
user agnet string is part of header of http requests it identifies web client making call, of course since it's just a string it can be anything. but if web browser was installed correctly it should indicate what browser is default. more about UA strings can be found here:
http://msdn.microsoft.com/en-us/library/ms537503.aspx

2) this can be difficult if possible at all, you can try number of different tricks like enumerating processes and look for iexplorer.exe or firefox.exe or ... you can also enumerate all top level windows read it's caption and check if it contains sub-string like "mozzila fire fox" or "microsoft internet explorer".
but anyone can write it's own app place TWebBrowser and then none of those tricks will work.

3) same as 2)

ziolko.
0
 

Author Comment

by:geocoins-software
Comment Utility
Yeah, thats what I figured. Thanks!
0
 
LVL 21

Expert Comment

by:ziolko
Comment Utility
3) not to mention web browser with multiple tabs there's no guarantee that those tabs are window controls and have handles at all.

ziolko.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

9 Experts available now in Live!

Get 1:1 Help Now