Solved

Webbrowser Handle

Posted on 2008-10-03
5
451 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
[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
  • 2
5 Comments
 
LVL 21

Expert Comment

by:ziolko
ID: 22636331
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
ID: 22636414
>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
ID: 22636657
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
ID: 22636744
Yeah, thats what I figured. Thanks!
0
 
LVL 21

Expert Comment

by:ziolko
ID: 22636758
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

691 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