Solved

Getting the url from IE or Netscape

Posted on 2000-04-15
2
173 Views
Last Modified: 2010-04-10
Hi !
I want to develop an app. in which i will use a indefinite thread. this thread will woke up after every 2000 millisecondd and find out is there any netscape or ie window open. if yes ! then this app. will retreive the url from the browser and store it into a text file.

I want to know how can i get the url from browser.

Notes: this app. will start as soon as user logs on his computer and start working in background.
0
Comment
Question by:sun307
[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 Comments
 
LVL 1

Accepted Solution

by:
Toad224 earned 100 total points
ID: 2719133
This will find if the browser window is open.

FindWindow("IEFrame", NULL)

it will return a non 0 value if the browser is open, and a 0 value if it is not open.

This will detect the URL that the user is currently at:

HWND Wnd = FindWindow("IEFrame, NULL);
HWND Worker = FindWindowEx(Wnd, 0, "WorkerA", NULL);
HWND ReBar = FindWindowEx(Worker, 0, "ReBarWindow32", NULL);
HWND Combo = FindWindowEx(ReBar, 0, "ComboBoxEx32", NULL);
HWND ComboBox = FindWindowEx(Combo, 0, "ComboBox", NULL);
HWND Edit = FindWindowEx(ComboBox, 0, "Combo", NULL);

int Len = GetWindowTextLength(Edit);
LPSTR Str = new char[Len + 1];
GetWindowText(Edit, Str, Len + 1);


The URL will be returned in Str.
0
 
LVL 2

Author Comment

by:sun307
ID: 2721611
Thanx toad !
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Getting IP address 8 104
Embarcadero C++ Builder XE2 TDateTime 8 80
Embarcadero WebBroker REST server endpoint parameters 2 96
Indy 10 not Receiving UDP broadcast 3 43
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

726 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