Solved

Webbrowser Handle

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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
tvirtualstringtree freeze when load too manny images 10 80
update joined tables 2 62
firemonkey Android Listview Sort items 7 73
Using MMsystem To change audio input 1 18
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

749 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