Solved

Getting the url from IE or Netscape

Posted on 2000-04-15
2
169 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
2 Comments
 
LVL 1

Accepted Solution

by:
Toad224 earned 100 total points
Comment Utility
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
Comment Utility
Thanx toad !
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now