Редактиране

Споделяне чрез


WM_DWMSENDICONICLIVEPREVIEWBITMAP message

Instructs a window to provide a static bitmap to use as a live preview (also known as a Peek preview) of that window.

Parameters

wParam

Not used.

lParam

Not used.

Return value

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

Remarks

A live preview (also known as a Peek preview) of a window appears when a user moves the mouse pointer over the window's thumbnail in the taskbar or gives the thumbnail focus in the ALT+TAB window. This view is a full-sized preview of the window and can be a live snapshot or an iconic representation.

Desktop Window Manager (DWM) sends this message to a window if all of the following situations are true:

  • Live preview has been invoked on the window.
  • The DWMWA_HAS_ICONIC_BITMAP attribute is set on the window.
  • An iconic representation is the only one that exists for this window.

The window that receives this message should respond by generating a full-scale bitmap. The window then calls the DwmSetIconicLivePreviewBitmap function to set the live preview. If the window does not set a bitmap in a given amount of time, DWM uses its own default iconic representation for the window.

Examples

The following example demonstrates a response to the WM_DWMSENDICONICLIVEPREVIEWBITMAP message. The example calls the DwmSetIconicLivePreviewBitmap function with a handle to a customized, device-independent bitmap to use as the window's representation.

        case WM_DWMSENDICONICLIVEPREVIEWBITMAP:
        {
            // This window is being asked to provide a bitmap to show in Peek preview.
            // This indicates the thumbnail in the taskbar is being previewed.
            RECT rectWindow = {0, 0, 0, 0};
            if (GetClientRect(hwnd, &rectWindow))
            {
                nWidth = rectWindow.right - rectWindow.left;
                nHeight = rectWindow.bottom - rectWindow.top;
            }

            hbm = CreateDIB(nWidth, nHeight);
            if (hbm)
            {
                hr = DwmSetIconicLivePreviewBitmap(hwnd, hbm, NULL, DWM_SIT_DISPLAYFRAME);
                DeleteObject(hbm);
            }
        }
        break;

For the complete code, 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

WM_DWMSENDICONICTHUMBNAIL

DwmInvalidateIconicBitmaps