Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Search Providers: Best Practices on Setting the Default

17 Feb 2010   #1
SGT Oddball

Search Providers: Best Practices on Setting the Default

This post describes a set of best practices for setting the default search provider. Our goal continues to be keeping users in control of their browser, following our published Guidelines and Requirements for add-on development.

If you write software that modifies Internet Explorerís search settings or defaults through direct registry manipulation, your software may be contributing to user confusion and frustration.

Whenever a program tries to modify the default search provider through direct registry manipulation (e.g. modifying the DefaultScope registry key directly as described in an earlier blog post ), IE8 intercepts the change and prompts users to confirm what they want:

Figure 1: In this dialog, the software requests a search default change using the recommended SetDefault API and clear attribution is displayed. In this case, it is the Contoso Internet Toolbar software.

If multiple search providers try to reset the registry key every time it changes, it causes a confusing and frustrating user experience. The above dialog box will re-appear every time the key is modified directly.

IE8 includes a Search Provider Default configuration experience designed for this scenario. When your software uses the IOpenServiceManager API (to install a search provider) and the SetDefault API (to request users set it as their default), users will see clearer communication about what is happening. This transparency is an important part of the user being in control.

The following code sample shows how to install a search provider and request that the user set it as the default using the recommended APIs.


BOOL fComInitialized = FALSE;

if (S_OK == CoInitialize(NULL))
fComInitialized = TRUE;

//Open a handle to the OpenService manager
CComPtr spManager;
hr = spManager.CoCreateInstance(CLSID_OpenServiceManager);

if (SUCCEEDED(hr))
CComPtr spService;

//Install my search provider
hr = spManager->InstallService(URL-OF-SERVICE, &spService);

if (hr==S_OK)
//Request that the user changes their search default
hr = spService->SetDefault(TRUE, NULL);

if (fComInitialized)

When called, the SetDefault API will show the above dialog (See Figure 1 above) requesting the user to change their search default. The user can approve or deny this request from the software. If approved, the software can change the default setting. If denied, however, the software will not be allowed to change the user's default settings. The user can change the setting at any time by opening the Manage Add-ons window.

If the binary that is calling the SetDefault API is signed with a valid code signing certificate, the program name and publisher will be displayed in the Search Provider Default dialog box as in Figure 1 above. Code that calls SetDefault should be signed.

In summary, if your software monitors the DefaultScope registry key directly, please update your code to use the recommended APIs. This will allow the user to see the search provider default dialog only once and lets them be in full control of their default, in support of the Guidelines for add-on development.

If you are new to OpenSearch Extensibility and would like to learn how to offer your services or how to get started, check out the article Search Provider Extensibility in Internet Explorer.

Until next time,

Duc (Cash) Vo
Programmer Writer
Internet Explorer


My System SpecsSystem Spec

 Search Providers: Best Practices on Setting the Default

Thread Tools

Similar help and support threads
Thread Forum
How do I get into search providers in Add Ons?
I want to add search provider to the list of Search Providers in Manage Add Ons. I am using IE10 and I have looked in help but what I am being told to do does not tie up with what I am seeing on the screen. I think the answer is to get Duckduckgo into the list of Add-ons in the...
Browsers & Mail
Add custom search providers to IE9
Is there a way to do it? I can do it in IE8 and IE10 but not in IE9 :confused: Can anyone help?
Browsers & Mail
Sysprep + IE Search Providers Error
First off, I'm sorry if this is in the wrong thread, it's the closest description I could find, if it needs moving, please move it moderators. I have searched SevenForums and the web trying to fix this, and I'm still at a loss. I am deploying Windows 7 Pro x64 to multiple computers using...
Installation & Setup
Windows 7 Federated Search Providers
Windows 7 Search Federation Providers With the demonstration of Windows 7`s OpenSearch Providers by Long Zheng (Flickr Search Connector for Windows 7 Search Federation) I have created these providers for Searching Youtube, Google, Google News, GoogleBlogs, MSN and Yahoo.

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 04:01.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App