Operations in the Delphi Browser

Source: Internet
Author: User

// Obtain the default Internet browser function getdefashshellhttp: string; var REG: Tregistry; strword: string; begin strword: = ''; Reg: = Tregistry. create; Reg. rootkey: = hkey_classes_root; If Reg. keyexists ('HTTP \ shell \ open \ command') then begin Reg. openkey ('HTTP \ shell \ open \ command', false); strword: = reg. readstring (''); Reg. closekey; end; Reg. free; Reg: = Tregistry. create; Reg. rootkey: = hkey_classes_root; If Reg. keyexists ('htmlfile \ shell \ open \ command') then begin Reg. openkey ('htmlfile \ shell \ open \ command', false); strword: = strword + ',' + Reg. readstring (''); Reg. closekey; end; Reg. free; Reg: = Tregistry. create; Reg. rootkey: = hkey_classes_root; If Reg. keyexists ('mhtmlfile \ shell \ open \ command') then begin Reg. openkey ('mhtmlfile \ shell \ open \ command', false); strword: = strword + ',' + Reg. readstring (''); Reg. closekey; end; Reg. free; Reg: = Tregistry. create; Reg. rootkey: = hkey_classes_root; If Reg. keyexists ('internetshortcut \ shell \ open \ command') then begin Reg. openkey ('internetshortcut \ shell \ open \ command', false); strword: = strword + ',' + Reg. readstring (''); Reg. closekey; end; Reg. free; Result: = strword; end; // set your own Internet browser function setdefashshellhttp (using line: string): Boolean; var REG: Tregistry; begin result: = false; Reg: = Tregistry. create; Reg. rootkey: = hkey_classes_root; // Registry address: If Reg. keyexists ('HTTP \ shell \ open \ command') then begin try Reg. openkey ('HTTP \ shell \ open \ command', true); // Registry address: Reg. writestring ('', cmdline); finally Reg. closekey; end; Reg. free; Reg: = Tregistry. create; Reg. rootkey: = hkey_classes_root; // Registry address: If Reg. keyexists ('htmlfile \ shell \ open \ command') then begin try Reg. openkey ('htmlfile \ shell \ open \ command', true); // Registry address: Reg. writestring ('', cmdline); finally Reg. closekey; end; Reg. free; Reg: = Tregistry. create; Reg. rootkey: = hkey_classes_root; // Registry address: If Reg. keyexists ('mhtmlfile \ shell \ open \ command') then begin try Reg. openkey ('mhtmlfile \ shell \ open \ command', true); // Registry address: Reg. writestring ('', cmdline); finally Reg. closekey; end; Reg. free; Reg: = Tregistry. create; Reg. rootkey: = HKEY_CURRENT_USER; // Registry address: If Reg. keyexists ('\ Software \ clients \ startmenuinternet') then begin try Reg. openkey ('\ Software \ clients \ startmenuinternet', true); // Registry address: Reg. writestring ('', application. title); finally Reg. closekey; end; Reg. free; // The following is the solution REG: = Tregistry for systems later than windwos 7. create; Reg. rootkey: = hkey_classes_root; // Registry address: If Reg. keyexists ('\ microblueweb') then begin try Reg. openkey ('\ microblueweb', true); // Registry address: If not Reg. keyexists ('Shell \ open \ command') then begin Reg. createkey ('Shell \ open \ command'); end; Reg. openkey ('Shell \ open \ command ', true); // Registry address: Reg. writestring ('', cmdline); finally Reg. closekey; end else begin try Reg. createkey ('microweb'); Reg. openkey ('\ microblueweb', true); // Registry address: Reg. createkey ('Shell \ open \ command'); Reg. openkey ('Shell \ open \ command ', true); Reg. writestring ('', cmdline); finally Reg. closekey; end; Reg. free; Reg: = Tregistry. create; Reg. rootkey: = HKEY_CURRENT_USER; // Registry address: If Reg. keyexists ('\ Software \ Microsoft \ Windows \ shell \ associations \ urlassociations \ HTTP \ userchoice') then begin try Reg. openkey ('\ Software \ Microsoft \ Windows \ shell \ associations \ urlassociations \ HTTP \ userchoice', true); // Registry address: Reg. writestring ('progid', 'microblueweb'); finally Reg. closekey; end; Reg. free; Result: = true; end; // register your browser function regeditweb (using line, path: string): Boolean; var REG: Tregistry; begin result: = false; Reg: = Tregistry. create; Reg. rootkey: = HKEY_LOCAL_MACHINE; // Registry address: If Reg. keyexists ('\ Software \ clients \ startmenuinternet') then begin try Reg. openkey ('\ Software \ clients \ startmenuinternet', true); // Registry address: If not Reg. keyexists ('\ Software \ clients \ startmenuinternet \' + cmdline) then begin Reg. createkey (cmdline); end; Reg. openkey (cmdline, true); // Registry address: Reg. writestring ('', using line); if not Reg. keyexists (using line + '\ shell \ open \ command') then begin Reg. createkey ('Shell \ open \ command'); end; Reg. openkey ('Shell \ open \ command ', true); Reg. writestring ('', PATH); finally Reg. closekey; end; Reg. free; Result: = true; end;

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.