CWnd::OnPaintClipboard

Syntax

afx_msg void OnPaintClipboard( CWnd* pClipAppWnd, HANDLE hPaintStruct );

Parameters

pClipAppWnd

Specifies a pointer to the Clipboard-application window. The pointer may be temporary, and should not be stored for later use.

hPaintStruct

Identifies a PAINTSTRUCT data structure that defines what part of the client area to paint.

Remarks

A Clipboard owner's OnPaintClipboard member function is called by a Clipboard viewer when the owner has placed data on the Clipboard in the CF_OWNERDISPLAY format and the Clipboard viewer's client area needs repainting.

To determine whether the entire client area or just a portion of it needs repainting, the Clipboard owner must compare the dimensions of the drawing area given in the rcpaint member of the PAINTSTRUCT structure to the dimensions given in the most recent OnSizeClipboard member function call.

OnPaintClipboard should use the GlobalLock Windows function to lock the memory that contains the PAINTSTRUCT data structure, and unlock that memory by using the GlobalUnlock Windows function before it exits.

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

See Also

::GlobalLock, ::GlobalUnlock, CWnd::OnSizeClipboard, WM_PAINTCLIPBOARD, CWnd::Default