Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Data Exchange
Clipboard
Clipboard Reference
Functions
 RegisterClipboardFormat Function
RegisterClipboardFormat Function

The RegisterClipboardFormat function registers a new clipboard format. This format can then be used as a valid clipboard format.

Syntax

UINT RegisterClipboardFormat(      
    LPCTSTR lpszFormat );

Parameters

lpszFormat
[in] Pointer to a null-terminated string that names the new format.

Return Value

If the function succeeds, the return value identifies the registered clipboard format.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

If a registered format with the specified name already exists, a new format is not registered and the return value identifies the existing format. This enables more than one application to copy and paste data using the same registered clipboard format. Note that the format name comparison is case-insensitive.

Registered clipboard formats are identified by values in the range 0xC000 through 0xFFFF.

When registered clipboard formats are placed on or retrieved from the clipboard, they must be in the form of an HGLOBAL value.

Windows 95/98/Me: RegisterClipboardFormatW is supported by the Microsoft Layer for Unicode (MSLU). To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.

Example

For an example, see Registering a Clipboard Format.

Function Information

Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systems Windows 95, Windows NT 3.1
UnicodeImplemented as Unicode version.

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker