VC transformation IE browser

xiaoxiao2021-03-06  16

Since Microsoft bundled IE, Networms did be destined to face the unchanging Microsoft mode: window, buttons and www.microsoft.com website, from the user's perspective, we hope to have its own characteristics IE; from commercial Operational angle, businessman wants to have no company's promotional information, I hope IE has automatically entered their website. The following author describes how to use VC6 to change the way IE appearance by modifying the registry.

VC Modify the method and function of the registry

The registry is composed of trunk and key, and the modification of the registry is the modification of the key.

First, to modify the key to the key to modify the handle, the key is opened in the VC, and the function can be used as the long regopenkey command; then you can modify the key, use the setRegvalue command; finally need to release the obtained key handle Using the Regclosekey (HRESULT) command.

Implement IE by modifying the registry

We all know that in the registry, the main setting of IE is in the Software // Microsoft // Internet Explorer under the key hkey_current_user, for example, we want to define the Software // of the initial access page of IE. "START Page" set by Microsoft // Internet Explorer // Main, such as "www.ccidnet.com". In addition, the user-specific background pattern can be added by modifying key_current_user and key hkey_local_machine below Software // Microsoft // Internet Explorer // Toolbar. We can realize the transformation of IE through the following code:

Void CJHfdlg :: onaddaddress ()

{

IF (addressnum == 0) {

AfxMessageBox ("No available options!");

Return;

}

CSTRING ADDRESS;

INT SEL = m_address1.getcursel ();

IF (lb_err == sel) {

AfxMessageBox ("Please select the option you want to apply!");

Return;

}

m_address1.gettext (SEL, Address);

/ / A web string you need to join

CString strkey = "Software // Microsoft // Internet Explorer // main";

HKEY HRESULT;

Regopenkey (HKEY_CURRENT_USER, (LPCTSTSTR) StrKey, && HRESULT

// Get the handle to modify the key

SetRegvalue (HKEY_CURRENT_USER, STRKEY, "START PAGE", Address;

RegcloseKey (HRESULT);

/ / Modify the corresponding value of the registry and release the key handle

}

2. Specify user-specific background patterns to the toolbar

Void cjhfdlg :: onaddbackground ()

{

IF (Picturenum == 0) {

AfxMessageBox ("No available options!");

Return;

}

CString Picture;

INT SEL = m_PICList.getcursel ();

IF (lb_err == sel) {

AfxMessageBox ("Please select the option you want to apply!");

Return;

}

M_PICList.getText (SEL, Picture);

// Get the required add to the background pattern file path

CString strkey = "Software // Microsoft // Internet Explorer // TOOLBAR";

HKEY HRESULT;

Regopenkey (HKEY_CURRENT_USER, (LPCTSTSTR) StrKey, && HRESULT

// Get the handle to modify the key

SetRegValue (HKEY_CURRENT_USER, STRKEY, "Backbitmapie5", Picture;

SetRegValue (HKEY_CURRENT_USER, STRKEY, "Backbitmap", Picture;

RegcloseKey (HRESULT);

/ / Modify the corresponding value of the registry and release the key handle

REGOPENKEY (HKEY_LOCAL_MACHINE, (LPCTSTSTSTSTSTESULT); && HRESULT

// Get the handle to modify the key

SetRegValue (HKEY_LOCAL_MACHINE, STRKEY, "Backbitmapie5", Picture;

SetRegValue (HKEY_LOCAL_MACHINE, STRKEY, "Backbitmap", Picture;

RegcloseKey (HRESULT);

/ / Modify the corresponding value of the registry and release the key handle

}

The above is only demonstrated from several simple aspects. The method of modifying the registry is implemented as IE. The reader can make more personalized modifications based on the above code to achieve true personalization IE.

转载请注明原文地址:https://www.9cbs.com/read-46842.html

New Post(0)