Windows salad: The Story Behind the default browser

Source: Internet
Author: User
Document directory
  • What is the default browser?
  •  
  • Extension Association
  • Registry
  • Protocol Association
  • Browser displayed in the Start Menu
  • Summary
  •  
  • References

In Windows, many browsers have the "default browser" function, which is basically available at home. In addition to browser settings, XP and win7 also provide many methods for setting. In particular, win7 provides a special setting item called "default program. So what are the stories behind these settings?

 

What is the default browser?

To study things, first define its scope and definition. So what is the default browser? I have summarized the following three parts:

 
 
 
Therefore, to set the default browser, you only need to clarify the three items above.

 

Extension Association

In the design of a Windows system, a software may have multiple extensions. To distinguish different software, an app corresponds to a programmatic identifiers, and an extension is associated with a progid. Of course, an app can have multiple progids. For example, one class can process file management and the other class can process other associations.

 

 

 

The following shows an example of the Firefox browser:

 

So where is the information stored?

 

Registry

 

The information shown above is saved in the registry, mainly located in

HKEY_CURRENT_USER \ Software \ Classes

HKEY_LOCAL_MACHINE \ SOFTWARE \ Classes

For ease of use, the registry definesThe hkey_class_root Root Key essentially contains the view after the key values of hkcu and HKLM are merged.The priority of hkcu is higher than that of HKLM.

 

Therefore:The read operation should be performed under hkey_class_root. If it is written, it is better to write it under HKEY_CURRENT_USER.

Take a look at the key values in the registry:

 

 

In the XP system, if you want to associate an extension with a program, you need to write the default value of this extension as the progid of the app, then Shell \ open \ command is read from the progid to execute the open operation.

 

 

In win7, one more step is required, that is, if there is a key value below, it will first read from the progid specified in the key value below:

HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ fileexts \. Ext \ userchoice \ progid

If the preceding progid key does not exist, it will be executed according to the rules in XP.

 

Protocol Association

 

For HTTP, https, and other protocols, the Association principle is similar to the extension, but there are differences in different systems.

In XP systems, HTTP and other protocols do not read open programs from the progid specified by the default extension, but directly read Shell \ open \ command under the HTTP key value.

 

In win7, the following key values are also read first:

HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ shell \ associations \ urlassociations \ HTTP \ userchoice \ progid

Note that the progid is read, and then the shell \ open \ command content is read from the progid. Instead

 

Browser displayed in the Start Menu

 

The browser displayed in the Start menu is read from the following:

HKEY_CURRENT_USER \ Software \ clients \ startmenuinternet \

For example, firefox.exe.

How does the system start firefox.exe?

This firefox.exe is located in

HKEY_CURRENT_USER \ Software \ clients \ startmenuinternet \

HKEY_LOCAL_MACHINE \ SOFTWARE \ clients \ startmenuinternet \

.

Shell \ open \ command \ under this key value \

 

This key value is the same in XP and win7.

 

Summary

Set the key value to be modified by default browser in XP

Change the default browser displayed in the Start Menu:

HKEY_CURRENT_USER \ Software \ clients \ startmenuinternet \@
New: String: "Google Browser"

 

Change the extension such as .htmdemo.html and write it to progid.
HKEY_CURRENT_USER \ Software \ Classes \. htm \@
New: String: "chromehtml"

 

Change HTTP, https, FTP, and other protocols

Write defaulticon
Write shell open command

HKEY_CURRENT_USER \ Software \ Classes \ FTP \ defaulticon \@
New: String: "C: \ Documents ents and Settings \ Administrator \ Local Settings \ Application Data \ google \ chrome \ Application \ chrome.exe, 0"

HKEY_CURRENT_USER \ Software \ Classes \ FTP \ shell \ open \ command \@
New: String: "" C: \ Documents ents and Settings \ Administrator \ Local Settings \ Application Data \ google \ chrome \ Application \ chrome.exe "--" % 1 ""

Key value to be modified under win7

Change the default browser displayed in the Start Menu:

HKEY_CURRENT_USER \ Software \ clients \ startmenuinternet \@
New: String: "Google Browser"

 

Change the extension such as .htmdemo.html and write it to progid.

HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ fileexts \. htm \ userchoice \ progid
New: String: "chromehtml"

 

Change HTTP, https, FTP, and other protocols

HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ shell \ associations \ urlassociations \ HTTP \ userchoice \ progid
New: String: "chromehtml"

References

Programmatic identifiers

The http://msdn.microsoft.com/en-us/library/cc144152 (vs.85). aspx

Msdn (included with vs2008 ):

Win32 and COM Development \ User Interface \ Windows User Experience \ Windows Shell \ shell developer's guide \ integration of applications into the shell for file format owners

Tool: regsnap

Related Article

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.