Solved

Getting the url from IE or Netscape

Posted on 2000-04-15
2
174 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

717 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