CWnd::OnSizeClipboard

Syntax

afx_msg void OnSizeClipboard( CWnd* pClipAppWnd, HANDLE hRect );

Parameters

pClipAppWnd

Identifies the Clipboard-application window. The pointer may be temporary and should not be stored.

hRect

Identifies a handle to a global memory object. The memory object contains a RECT data structure that specifies the area for the Clipboard owner to paint.

Remarks

The Clipboard owner's OnSizeClipboard member function is called by the Clipboard viewer when the Clipboard contains data with the CF_OWNERDISPLAY attribute and the size of the Clipboard-viewer window's client area has changed.

The OnSizeClipboard member function is called with a null rectangle (0,0,0,0) as the new size when the Clipboard application is about to be destroyed or minimized. This permits the Clipboard owner to free its display resources.

Within OnSizeClipboard, an application must use the GlobalLock Windows function to lock the memory that contains the RECT data structure. Have the application unlock that memory by using the GlobalUnlock Windows function before it yields or returns control.

This message-handler member function calls the Default member function. Override this member function in your derived class to handle the WM_SIZECLIPBOARD message.

See Also

::GlobalLock, ::GlobalUnlock, ::SetClipboardData, CWnd::SetClipboardViewer, CWnd::Default, WM_SIZECLIPBOARD