Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Reference
Functions
 DwmRegisterThumbnail Function

  Switch on low bandwidth view
DwmRegisterThumbnail Function

Creates a Desktop Window Manager (DWM) thumbnail relationship between the destination and source windows.

Syntax

HRESULT DwmRegisterThumbnail(      
    HWND hwndDestination,     HWND *hwndSource,     PHTHUMBNAIL phThumbnailId );

Parameters

hwndDestination
The handle to the window that will use the DWM thumbnail. Setting the destination window handles to anything other than a top level window type will result in an E_INVALIDARG.
hwndSource
The handle to the window to as the thumbnail source. Setting the source window handles to anything other than a top level window type will result in an E_INVALIDARG.
phThumbnailId
[out] The pointer to a handle that represents the registration of the DWM thumbnail.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

Registering a DWM thumbnail relationship will not modify desktop composition, see DwmUpdateThumbnailProperties for thumbnail positioning.

The window designated by the hwndDestination must either be the desktop window or be owned by the process calling DwmRegisterThumbnail . This is done to prevent applications affecting the content of other applications.

The thumbnail registration handle obtained by this function is not globally unique but is unique to the process. DwmUnregisterThumbnail is used to unregister the thumbnail and must be done within the process the relationship was registered in.

Example

The following sample demonstates how to register the Desktop thumbnail.

HRESULT UpdateDesktop(HWND hwnd)
{
	HRESULT hr = S_OK;

	//Register Thumbnail
	HTHUMBNAIL thumbnail = NULL;

	hr = DwmRegisterThumbnail(hwnd, FindWindow(_T("Progman"), NULL), &thumbnail);
	if (SUCCEEDED(hr))
	{
		//display thumbnail using DwmUpdateThumbnailProperties
	}
	return hr;	
}

Function Information

Minimum DLL Versiondwmapi.dll
Headerdwmapi.h
Import librarydwmapi.lib
Minimum operating systems Windows Vista

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Syntax is wrong      pulp   |   Edit   |   Show History
the syntax is:

HRESULT DwmRegisterThumbnail(      
HWND hwndDestination,
HWND hwndSource,
PHTHUMBNAIL phThumbnailId
);

(HWND *hwndSource is wrong)

Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker