CWnd::OnPaintClipboard

 

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

Syntax

      afx_msg void OnPaintClipboard(
   CWnd* pClipAppWnd,
   HGLOBAL 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

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 with the GlobalUnlock Windows function before it exits.

Note

This member function is called by the framework to allow your application to handle a Windows message. The parameters passed to your function reflect the parameters received by the framework when the message was received. If you call the base-class implementation of this function, that implementation will use the parameters originally passed with the message and not the parameters you supply to the function.

Requirements

Header: afxwin.h

See Also

CWnd Class
Hierarchy Chart
GlobalLock
GlobalUnlock
CWnd::OnSizeClipboard
6f9bcf0e-04e6-4a24-b0f6-baae4617998f#_mfc_cwnd.3a3a.onpaintclipboard