[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

Getting the url from IE or Netscape

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
sun307
Asked:
sun307
1 Solution
 
Toad224Commented:
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
 
sun307Author Commented:
Thanx toad !
0

Featured Post

Technology Partners: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now