Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Determine what browser is active on XP & win 98 os thru C++ coding

Posted on 2002-05-29
7
Medium Priority
?
250 Views
Last Modified: 2010-04-02
How can I determine what browser ( IE / Netscape / Opera) is active though C++ coding i.e. is there a flag set in the registry or an api call that could find the answer ? Need it for xp and 98 os.
thxs ............r
0
Comment
Question by:rexman
[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
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 7042350
You could get that info from the registry, but 'FindExecutable()' will render that also...
0
 
LVL 86

Expert Comment

by:jkr
ID: 7042363
BTW, the place to look that up in the registry is

HKEY_CLASSES_ROOT\htmlfile\shell\open\command
0
 

Author Comment

by:rexman
ID: 7044556
thxs jkr,
but I have checked the registry location that you mentioned and there was just a path to iexplore.ex, no matter what browser I had active (Only one browser was active at a time). FindExecutable() retrieves the name of and handle to the executable file associated with the specified file name. So if I use this function for each of the browser's .exe it should return file not found for the two browsers that are not active and a value greater that 32 for the current active browser ?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 49

Accepted Solution

by:
DanRollins earned 300 total points
ID: 7045391
By 'active browser' I think you mean the one that the user is working with at a certain moment in time (rather than the browser that the user has chosen as the default browser).

There are several scenarios:

1) There is no browser active
2) Both Netscape and IE are active, but neither is in front (imagine that Notepad.Exe is in front)
3) Both Netscape and IE are active, and IE is in front.
4) Both Netscape and IE are active, and Netscape is in front.
5) IE is open and is in front
6) Netscape is open and in front
7) Netscape is active, but a popup add generated by a minimized IE browser window is in the foreground.

So...
I suggest using GetForegroundWindow() then pass the HWND to GetWindowInfo and/or and/or GetWindowText and/or GetClassName.  That should provide enough info for satisify scenarios 3,4,5,6, or 7.  For other siturations, you are on your own.  Also, if your program is frontmost at the time, these will not help because now browser is active at that time.

Now if you want to see if any browser is open, you can uyse FindWindowEx or EnumWindows to cycle through all top-level windows and see what's what.
=-=-=-=-=-=-=-=--=
Why do you want to know?  If you explain that, I may be able to provide more specific info.

-- Dan
0
 
LVL 11

Expert Comment

by:griessh
ID: 7178860
Dear rexman

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "DanRollins"

comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points. The link to the Community Support area is: http://www.experts-exchange.com/commspt/


PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 

Author Comment

by:rexman
ID: 7185345
Sorry for not responding to DanRollins, but I got sidetracked for a while and when I returned to my question I found an easier answer to the question. I just take a snapshot of the active processes and search for all the browsers to determine which or how many of the
browsers the user currently has active.

but I accept DanRollins answer.
thxs....rexman
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7193793
hi rexman,
To award points to me, please click the [Accept Comment as Answer] button next to my comment.  In the next screem, choose a grade and click the [Submit] button.  Thanks!
-- Dan
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

688 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