Is there a way, either through a windows api call or other, to
determine which application has opened a URL, and if so what is it?
Eg/ was it a link in an email from Outlook, or a link opened from MSN,
or via a web browser etc.... |
Request for Question Clarification by
maniac-ga
on
03 Jan 2006 17:50 PST
Hello At0micb0mb,
On which system are you attempting to determine this information?
[1] the one running the application / opening the URL
OR
[2] the one referenced by the URL (e.g., a web server)
In case [2] there is no general solution (though I could suggest some
partial solutions).
In case [1] you could intercept the Windows calls opening the network
connection - this is a pretty advanced programming technique and
requires administrative privileges. You should also indicate which
version of MS Windows this has to run under as well.
--Maniac
|
Clarification of Question by
at0micb0mb-ga
on
03 Jan 2006 18:26 PST
Hi maniac.
thanks for looking into this question.
I am attempting to determine it from the information from the machine
opening the URL. I realised it would probably be a fairly advanced
technique (which is why i posted it here), it would only be needed
from a windows xp machine.
Cheers
Chris
|
Request for Question Clarification by
maniac-ga
on
04 Jan 2006 17:18 PST
Hello At0micb0mb,
It appears this question has a lot of parts to it - I'll have to pass
on a complete answer but will give you some pointers that should help
(or could help another answer more completely). If you consider this
an adequate answer for the fee - let me know, otherwise consider it
free advice.
[1] You need to determine the method / scope of the intercepted calls.
There is a good explanation of a number of alternatives at:
http://www.internals.com/articles/apispy/apispy.htm
(the methods for Windows SP would be similar to the ones described for NT / 2000)
[2] One alternative - something like the DLL method, try it on a
single program and then make it system wide once it is fully debugged.
See
http://www.microsoft.com/msj/0997/hood0997.aspx
for an explanation and sample code.
[3] Another alternative is the Winsock layered protocols described
with source code at
http://www.microsoft.com/msj/0599/LayeredService/LayeredService.aspx
[4] Something to consider - the application will make calls such as:
- open the network connection with the host & port number
- write data to the network connection with the URL, see the HTTP description at
http://www.faqs.org/rfcs/rfc2616.html
(look for the GET command...)
- read responses including redirection, page contents, status (e.g., errors) etc.
(in the case of a redirection, another GET should be seen)
Unless your inquiry is extremely limited, this could be a lot of work
[5] You also need a "safe" method to store the information captured.
You could put the data into a database, write to a network connection
(which would sequence the data captured), or with care write to a
local file. Remember - more than one program could be active at the
same time, causing problems with the data recorded.
--Maniac
|