Get the web address of your browser's address bar in real time

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.