Thursday 15 March 2012

c++ - Check Which Website is Visited -


I am having trouble viewing whether the user of the program is going to a particular website. If I want to open a pop up box which was told to me what website I was on, what would be the best way to do this?

I was thinking about different ways but I have ever thought of checking which browser is open by browsing the definitive conclusion process or checking the window, but how do I find it? Even if I can not find the exact website address but just the name is correct.

For example, now the window says open which website was viewed - stack overflow - Mozilla Firefox, is it a way to get from the point of view of programming? Like some kind of check and read what windows are currently open

Thanks for any help.

This code to get the title of the active window use:

  Hwnh hwd = gatemoorgroundwondo (); CSTring title; LPTSTR str = title.GetBufferSetLength (GetWindowTextLength (hwnd)); GetWindowText (hwnd, str, title.GetLength () + 1); If (title.IsEmpty ()) title = _T ("user desktop"); ...   

The active window will be under "Heading".

Use this code to get an active running app:

  DWOP PID; GetWindowThreadProcessId (GetForegroundWindow (), & amp; pid); Handle H Procedure = Open Process (PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid); If (H. process! = Null) {TCHAR path [MAX_PATH] = {0}; TCHR filename [MAX_PATH] = {0}; GetProcessImageFileName (HPR, Path, MAX_PATH); _wsplitpath (path, faucet, faucet, file name, faucet); CloseHandle (hProcess); ...   

The filename will catch the active application

No comments:

Post a Comment