To explore a problem, I want to write an EXE, the function is real-time access to the browser address bar page address, there is no good idea,
Many people said that by Findwindows to get a handle to the browser, and then send a message to get the contents of the browser address bar edit box, but I think it is not very good,
Because this way to IE6 can also, if it is Google Browser and so on other browsers is not a good way out, do you think?
I hope we all talk about ideas, all of them.
Reply to discussion (solution) now many browsers use Directui, the traditional way to find the "Address bar" control is not appropriate.
For IE kernel browsers, it is recommended to look for a child window with the class name Internet Explorer_server.
Get the IHTMLDocument interface through the window handle, and then you can do whatever you want to do.
Google Browser and other non-IE kernel, did not find such an interface. Then do it. Ie/ff/chrome three browser plug-ins to get another method:
Write a DLL to inject the browser, HOOK HTTP protocol related APIs, directly from the packet to find the URL, suitable for all browsers.
Related API Reference:
InternetOpen
InternetConnect
HttpOpenRequest
HttpSendRequest
This is not good, there are similar malicious software behavior, a lot of security software and browser security mechanism will prevent this kind of operation.
For IE, the normal way to get URLs is through COM, but for the protection mode of IE also need to set up the protection mode API. For Chrome and Firefox, the standard way is to write plug-ins (both temporarily also support NPAPI, so plug-ins can be generic, but later Google will turn to Ppapi), and then through the IPC and other processes to communicate. IE can also be used by the ActiveX plugin, because the need for permissions on ActiveX, even in protected mode, is also in a certain privileged process to run.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Get the web address of your browser's address bar in real time