Delen via


CRichEditCtrl::CanPaste

Determines if the rich edit control can paste the specified Clipboard format.

BOOL CanPaste( 
   UINT nFormat = 0  
) const;

Parameters

  • nFormat
    The Clipboard data format to query. This parameter can be one of the predefined Clipboard formats or the value returned by RegisterClipboardFormat.

Return Value

Nonzero if the Clipboard format can be pasted; otherwise 0.

Remarks

If nFormat is 0, CanPaste will try any format currently on the Clipboard.

For more information, see EM_CANPASTE message and RegisterClipboardFormat function in the Windows SDK.

Example

// Paste the clipboard data if possible. 
if (m_myRichEditCtrl.CanPaste())
{
   m_myRichEditCtrl.Paste();
}

Requirements

Header: afxcmn.h

See Also

Reference

CRichEditCtrl Class

Hierarchy Chart

CRichEditCtrl::Paste

CRichEditCtrl::PasteSpecial