Write your own IE SKIN with C + + Builder

Source: Internet
Author: User

Today, the emergence of software skin boom, we are not want to decorate their own ie? Of course there are a lot of internet for IE skin-changing software, with enough of IE skin and other for IE skin friends, have you ever thought of compiling a own ie skin?

In fact, changing the skin of IE is only in the registry of "HKEY_CURRENT_USER\Software\Microsoft\Internet E

Xplorer\toolbar the new two string subkey "Backbitmap" and "BackBitmapIE5" to specify the background image path for IE.

All right, follow me down here.

Create a new application in C + + Builder, set its Caption property to "My IE SKIN", create a new panel control on it, change Panel1 's Caption property to empty, and the Align property to "Altop." Create a new label control on the Panel1 and change the Label1 Caption property to "path:". Then create a new edit control on the Panel1, change the Edit1 Name property to "URL" (no quotes), and change its Text property to empty. Then create a new OpenDialog control on the Panel1 and set the OpenDialog1 Filter property to "Bitmap|*.bmp". Then create a new button control on the Panel1 and change the Button1 caption to "Browse ...". Then create a button control on the Panel1 and change the Button2 caption to "Modify IE shell". Create a new Scrollbox control on Form1 (PANEL1), set its Align property to "Alclient", create a new image control on ScrollBox1, and set its AutoSize property to "true". All right, the interface part is finished, the following is the code to write!

We created the image control to preview the images in real time, so write the following code for the onchange event of the URL (EDIT):

void __fastcall TForm1::URLChange(TObject *Sender)
   {
Image1->Picture->LoadFromFile(URL->Text); //预览图形文件
   }

So as long as the path in the URL changes in the image will be changed to display the image!

Below we complete the "Browse ..." button, and double-click the "Browse ..." button to write the following code for its Click event:

if (OpenDialog1->Execute())
   {
    URL->Text=OpenDialog->FileName;//将文件名填入URL编辑框
    Image1->Picture->LoadFromFile(URL->Text);//预览图形文件
   }
   下面是最重要的部分,双击“修改IE外壳”按钮,为其单击事件编写代码:
   void __fastcall TForm1::Button1Click(TObject *Sender)
   {
    if (strlen(url->Text.c_str())>=5) //主文件名+.+BMP不可能小于5个字符
    {
     TRegistry &regkey=*new TRegistry();//新建一注册表类
     regkey.OpenKey("Software\\Microsoft\\Internet Explorer\\Toolbar",true);//打开要新建或要修改的键名
     regkey.WriteString("BackBitmap",url->Text.c_str());//修改
     regkey.WriteString("BackBitmapIE5",url->Text.c_str());
     regkey.CloseKey();//关闭所有打开的注册表键名
     delete &regkey;//删除注册表类
    }
    else
    {
     Application->MessageBox("BMP图象路径不可能少于5个字符","错误",MB_OK);
    }
   }

OK, so the whole program is finished, save, compile, run, how? No effect?! Restart your IE look, the effect of it!

If you have any questions, please contact me.

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.