Implementing Display Control Panel Extensions in Win95/98

Updated: December 4, 2001

The Microsoft Windows family of operating systems include a Display Control Panel that allows users to modify their display adapter settings. Certain display hardware configurations may implement features that cannot be exposed through the standard property pages. To make such features easily available, OEMs and IHVs may want to extend the Display Control Panel. This article outlines the requirements for such extensions, as well as specific implementation details for Windows operating systems.

Note on WHQL Testing Guidelines for OpenGL Support. Vendors can implement a checkbox in the OpenGL control panel to disable the "Wait for Vblank" functionality. This checkbox must be located on an OpenGL accelerator property page and can only affect OpenGL page swap. It cannot affect Microsoft DirectDraw or GDI performance. This option is allowed for Windows 98 OpenGL and Windows NT 4.0 OpenGL drivers.

Vendors should work with SPEC and other benchmark providers to ensure that this feature is supported by way of the OpenGL extension API, as this is the only method allowed for Windows 2000 and later operating systems.

On This Page
Requirements for Display Control Panel Extensions
Requirements for Display Control Panel Extensions
Implementing Custom Property Pages for Windows 2000/Windows XP
Implementing Custom Property Pages for Windows 2000/Windows XP
Implementing Custom Property Pages for Windows 95/98/Me
Implementing Custom Property Pages for Windows 95/98/Me
ReferencesReferences
*

Requirements for Display Control Panel Extensions

The following are requirements for extensions to the display Control Panel:

Existing property pages must remain unchanged. Any Microsoft-provided property page (including Settings) must not be disabled, modified, removed, or replaced.

Custom property pages can be added only under Advanced Properties. The features exposed at the top level are commonly accessed features that are included in every Windows system. Because Windows 2000 and later operating system versions support multiple displays, custom property pages cannot be added to the top-level property page set in the Display Control Panel.

Control Panel extensions must be able to operate with existing Windows Control Panel elements.

Custom property pages must be labeled with an icon in addition to the text name. In order to prevent conflicts with future operating system or shell releases, third-party tabs must contain, in addition to the page label, either an icon (with the company's logo) or text with the name of the vendor. For example, "Acme Video Controls" is acceptable; "Video Controls" is not.

Control panel extensions must not initialize if the necessary hardware/driver combination is not present. If the display hardware that ships with the custom Control Panel extensions is not present, the extensions should not load. Likewise, if a custom property page has features that are dependent on proprietary driver extensions (for example, extensions that are not guaranteed to be present in every other display driver), those features must disable themselves, or the property page must not load when the necessary driver is not installed.

The Control Panel extension must respect the Hide modes that this monitor cannot display checkbox in the Monitor tab. If the checkbox option is checked, then the Control Panel extension must not display any modes that are not enumerated by EnumDisplaySettings (described in the Platform SDK documentation).

Control panel state must be stored in the registry. No .ini files are allowed. Any state that is maintained by your Control Panel extension must be stored in the SOFTWARE key in the registry, accessible through HKR in the INF.

Top of pageTop of page

Implementing Custom Property Pages for Windows 2000/Windows XP

See the current Windows DDK.

Top of pageTop of page

Implementing Custom Property Pages for Windows 95/98/Me

Adding property pages to the Display Control Panel Windows 95 implements only a single method for extending the Display Control Panel. Windows 98 adds two more methods, which allow third-party property pages to be added to the Advanced Properties dialog under the top-level Display Control Panel.

For display drivers that will work with both Windows 95 and Windows 98, IHVs and OEMs should use the Windows 95-compatible mechanism, and and must install their property pages via the driver INF.

For drivers that are intended to be installed on Windows 98 only, IHVs and OEMs should use the Windows 98 mechanism to add their pages to the Advanced Properties dialog for the particular adapter.

Windows 98: Adding pages to Advanced Properties for a particular adapter Windows 98 offers a new way of adding property pages to the Display Control Panel that allows vendors to extend the Advanced Properties page of a particular adapter. This is the recommended method of installing Display Control Panel extensions, and is especially important with regard to multiple display systems, where two or more third-party extensions may co-exist in the control panel. Windows 95 does not implement this feature.

Windows 98 will load all extensions listed in the following registry key:

HKR\shellex\PropertySheetHandlers

These will be placed on the Advanced Properties dialog associated with the device.

Windows 98: Adding pages to Advanced Properties for all adapters The method of adding pages to Advanced Properties for all adapters should not be used to expose new display adapter features in Windows 98. It is described here for informational purposes only. Windows 98 offers a new way of adding property pages to the Display Control Panel that allows vendors to extend the Advanced Properties page of all display adapters in the system. Windows 95 does not implement this feature.

Windows 98 will load all extensions listed in the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
	\Controls Folder\Device\shellex\PropertySheetHandlers

These will be placed on the Advanced Properties dialog associated with every device.

Windows 95 compatibility: Adding pages to the top-level Display control panel For backwards compatibility, Windows 98 will load property pages from the old registry key in the same way as Windows 95. Under Windows 95, this is the only way to extend the display control panel.

Windows 95 and Windows 98 will load all extensions listed in the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
	\Controls Folder\Display\shellex\PropertySheetHandlers

In Windows 95, these will be placed at the top level.

In Windows 98, these will be placed on the Advanced Properties dialog of the display adapter whose INF was used to install the property sheet (or sheets).

Determining which adapter If you are writing an extension designed to go on the Advanced Properties page, you need to know what display adapter to deal with. You should write your code to work on a secondary adapter.

When an extension is initialized (IShellExtInit::Initialize), it gets passed an IDataObject. Your extension can query information from this IDataObject using IDataObject->GetData(). If this call fails, assume you are running on the primary adapter.

If you ask forYou get

"Display Device"

the adapter device (ie \\.\DisplayX)

"Display Name"

the adapter name (ie ATI Mach64 Turbo 3)

"Monitor Device"

the monitor device (ie \\.\DisplayX\Monitor3)

"Monitor Name"

the monitor name (ie NEC multi-sync II)

Using the DeviceName, the extension can use CreateDC(NULL, "DeviceName", NULL, NULL) to talk directly with the display driver.

Using the DeviceName, the extension can use ChangeDisplaySettingsEx(DeviceName, ...) to modify the current or registry settings of the display device.

For example:


int cfDeviceName = RegisterClipboardFormat("Display Device");
FORMATETC fmt = {cfDeviceName, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};	
STGMEDIUM stg;
CHAR szDeviceName[128];

if (SUCCEEDED(pDataObject->GetData(&fmt, &stg)) && stg.hGlobal)
{
	// we got the device name from the cpl copy it localy
	lstrcpy(szDeviceName, GlobalLock(stg.hGlobal));
	GlobalUnlock(std.hGlobal)'
	GlobalFree(stg.hGlobal);
}
else
{
	// not the Win98 CPL assume primary display (Win95)
	lstrcpy(szDeviceName, TEXT("DISPLAY"));
}

if (lstrcmpi(szDeviceName, TEXT("DISPLAY")) == 0)
	hdc = CreateDC(szDeviceName, NULL, NULL, NULL);
else
	hdc = CreateDC(NULL, szDeviceName, NULL, NULL);

Escape(hdc, SOMECUSTOMESCAPE, ....);
DeleteDC(hdc);


Top of pageTop of page

References

Windows DDK:
Complete reference for all versions of Windows. See http://www.microsoft.com/whdc/devtools/ddk/default.mspx.

Windows 95 DDK references:

Chapter 10 discusses the format of INF files for display driver installation disks.

Win32 SDK reference:

Search for the CPIApplet function in Win32.hlp to find information on writing control panel applets.

Search for Property Sheet Handlers to find information on adding custom property sheets.


Top of pageTop of page