Skip to content

Latest commit

 

History

History
135 lines (93 loc) · 4.64 KB

nf-winuser-getclipboardformatnamea.md

File metadata and controls

135 lines (93 loc) · 4.64 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name req.apiset
NF:winuser.GetClipboardFormatNameA
GetClipboardFormatNameA function (winuser.h)
Retrieves from the clipboard the name of the specified registered format. The function copies the name to the specified buffer. (ANSI)
GetClipboardFormatNameA
winuser/GetClipboardFormatNameA
dataxchg\getclipboardformatname.htm
dataxchg
VS|winui|~\winui\windowsuserinterface\dataexchange\clipboard\clipboardreference\clipboardfunctions\getclipboardformatname.htm
12/05/2018
GetClipboardFormatName, GetClipboardFormatName function [Data Exchange], GetClipboardFormatNameA, GetClipboardFormatNameW, _win32_GetClipboardFormatName, _win32_getclipboardformatname_cpp, dataxchg.getclipboardformatname, winui._win32_getclipboardformatname, winuser/GetClipboardFormatName, winuser/GetClipboardFormatNameA, winuser/GetClipboardFormatNameW
winuser.h
Windows.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
GetClipboardFormatNameW (Unicode) and GetClipboardFormatNameA (ANSI)
User32.lib
User32.dll
Windows
19H1
GetClipboardFormatNameA
winuser/GetClipboardFormatNameA
c++
APIRef
kbSyntax
DllExport
User32.dll
API-MS-Win-RTCore-NTUser-clipboard-l1-1-0.dll
minuser.dll
Ext-MS-Win-NTUser-Misc-l1-1-0.dll
Ext-MS-Win-NTUser-Misc-l1-2-0.dll
Ext-MS-Win-NTUser-Misc-l1-3-0.dll
api-ms-win-ntuser-ie-clipboard-l1-1-0.dll
ie_stubs.dll
ext-ms-win-ntuser-misc-l1-3-1.dll
Ext-MS-Win-NTUser-Misc-L1-4-0.dll
Ext-Ms-Win-NTUser-Misc-L1-5-0.dll
Ext-MS-Win-NTUser-Misc-L1-5-1.dll
GetClipboardFormatName
GetClipboardFormatNameA
GetClipboardFormatNameW
ext-ms-win-ntuser-misc-l1-1-0 (introduced in Windows 8)

GetClipboardFormatNameA function

-description

Retrieves from the clipboard the name of the specified registered format. The function copies the name to the specified buffer.

-parameters

-param format [in]

Type: UINT

The type of format to be retrieved. This parameter must not specify any of the predefined clipboard formats.

-param lpszFormatName [out]

Type: LPTSTR

The buffer that is to receive the format name.

-param cchMaxCount [in]

Type: int

The maximum length, in characters, of the string to be copied to the buffer. If the name exceeds this limit, it is truncated.

-returns

Type: int

If the function succeeds, the return value is the length, in characters, of the string copied to the buffer.

If the function fails, the return value is zero, indicating that the requested format does not exist or is predefined. To get extended error information, call GetLastError.

-remarks

Security Considerations

Using this function incorrectly might compromise the security of your program. For example, miscalculating the proper size of the lpszFormatName buffer, especially when the application is used in both ANSI and Unicode versions, can cause a buffer overflow. Also, note that the string is truncated if it is longer than the cchMaxCount parameter, which can lead to loss of information.

Examples

For an example, see Example of a Clipboard Viewer.

Note

The winuser.h header defines GetClipboardFormatName as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

-see-also

Clipboard

Conceptual

EnumClipboardFormats

Reference

RegisterClipboardFormat