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
Solved

Webbrowser Handle

Posted on 2008-10-03
5
443 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
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to fill array with TArray.Create? 14 95
FMX StringGrid1->Canvas->FillRect Problem 3 170
Delphi Form ownership 4 111
how to send memory stream from ics Client To ics server ? 11 135
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 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