WM_DWMSENDICONICTHUMBNAIL message

Instructs a window to provide a static bitmap to use as a thumbnail representation of that window.

Parameters

wParam

Not used.

lParam

The HIWORD of this value is the maximum x-coordinate of the thumbnail. The LOWORD is the maximum y-coordinate. If a thumbnail has a dimension that exceeds one or both of these values, the DWM does not accept the thumbnail.

Return value

If an application processes this message, it should return zero.

Remarks

DWM sends this message to a window if all of the following situations are true:

  • DWM is displaying an iconic representation of the window.
  • The DWMWA_HAS_ICONIC_BITMAP attribute is set on the window.
  • The window did not set a cached bitmap.
  • There is room in the cache for another bitmap.

The window that receives this message should respond by generating a bitmap that is not larger than the size that is requested in the message parameters. The window then calls the DwmSetIconicThumbnail function to override the default thumbnail. If the window does not supply a bitmap in a given amount of time, DWM uses its own default iconic representation for the window.

The window must belong to the calling process.

Examples

The following code example shows how to respond to the WM_DWMSENDICONICTHUMBNAIL message. The example calls DwmSetIconicThumbnail, with a handle to a customized, device-indepedent bitmap to use as the windows' representation.

        case WM_DWMSENDICONICTHUMBNAIL:
        {    
            // This window is being asked to provide its iconic bitmap. This indicates
            // a thumbnail is being drawn.
            hbm = CreateDIB(HIWORD(lParam), LOWORD(lParam)); 
            if (hbm)
            {
                hr = DwmSetIconicThumbnail(hwnd, hbm, 0);
                DeleteObject(hbm);
            }
        }
        break;

For the complete example, see the Customize an Iconic Thumbnail and a Live Preview Bitmap sample.

Requirements

Requirement Value
Minimum supported client
Windows 7 [desktop apps only]
Minimum supported server
Windows Server 2008 R2 [desktop apps only]
Header
Dwmapi.h

See also

DwmInvalidateIconicBitmaps

WM_DWMSENDICONICLIVEPREVIEWBITMAP