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

 
Search Providers: Best Practices on Setting the Default

Quote:
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.

#include
#include
#include

HRESULT hr = E_FAIL;
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
//URL-OF-SERVICE: See http://www.opensearch.org/Specificat...ption_elements
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)
{
CoUninitialize();
}


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

More...

My System SpecsSystem Spec
.

Reply

 Search Providers: Best Practices on Setting the Default




Thread Tools



Similar help and support threads for2: Search Providers: Best Practices on Setting the Default
Thread Forum
Solved How do I get duckduckgo.com into search providers in Add Ons? Browsers & Mail
Add custom search providers to IE9 Browsers & Mail
Sysprep + IE Search Providers Error Installation & Setup
Solved I IE9 how to add non default Search Providers Browsers & Mail
Add Search Providers to Internet Explorer Browsers & Mail

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 08:25 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33