Implement Network Ants "Use XXXXXX Download" features in IE Menu menu
[Author: 111222 Add Time: 2001-9-5 11:44:23]
Less nonsense, open VC , create a new ATL's DLL project, project name catchtxt
After seeing the wizard, I click Finish directly, and then add an interface to catchtxt: New ATL Object
The interface name is called Catch, then fill a method for this Catch interface: method is AddTxtTxt parameter BSTR BSTR
OK, open the Catch interface via Script and then call the Addtxt method.
We will make the addtxt pop-up dialog in successfully.
STDMETHODIMP CCATCHT :: Addtxt (BSTR BSTR)
{
Uses_Conversion;
CHAR * STR = OLE2A (BSTR);
MessageBox (NULL, STR, "from IE", MB_OK); // << ---
Return S_OK;
}
The desired HTM is written below
Var parentwin = exTernuarguments.parentwin.document.documentLement.innertext;
Var wsh = new activxObject ("catchtxt.catch");
IF (WSH)
Wsh.Addtxt (STR);
Script>
The above file is saved as gettxt.htm, and its function is to get the body in the web page. The body will be passed as the parameters of the Addtxt method to the topTxtXT.dll above.
OK ~~ The dynamic connection library has, the script file has, what is it?
Well ~~~~~ Modify the right-click menu of IE.
Create the following primary key:
HKEY_CURRENT_USER / SOFTWARE / Microsoft / Internet Explorer / Menuext / Get web text
Change its default value to gettxt.htm path, I is d :/gettxt.htm. and yours? Will not use it like me ~~~
------------------------------
All of them, it is so simple to realize it .... Oh,
But if you want a good implementation, it is not easy ....
One point pointed out that when you use JS to do HTM, you must guarantee that Wshom.ocx is registered.