WinEnumClipbrdFmts: Difference between revisions
Appearance
mNo edit summary |
|||
Line 1: | Line 1: | ||
This function enumerates the list of clipboard data formats available in the clipboard. | This function enumerates the list of clipboard data formats available in the clipboard. | ||
==Syntax== | ==Syntax== | ||
Line 5: | Line 5: | ||
==Parameters== | ==Parameters== | ||
;hab (HAB) - input | ;hab (HAB) - input:Anchor-block handle. | ||
:Anchor-block handle. | ;fmt (ULONG) - input:Previous clipboard-data format index. | ||
;fmt (ULONG) - input | |||
:Previous clipboard-data format index. | |||
:Specifies the index of the last clipboard data format enumerated using this function. | :Specifies the index of the last clipboard data format enumerated using this function. | ||
:This should start at zero, in which instance the first available format is obtained. Subsequently, it should be set to the last format index value returned by this function. | :This should start at zero, in which instance the first available format is obtained. Subsequently, it should be set to the last format index value returned by this function. | ||
==Returns== | ==Returns== | ||
;ulNext (ULONG) - returns | ;ulNext (ULONG) - returns:Next clipboard-data format index. | ||
:Next clipboard-data format index. | |||
:Possible values include: | :Possible values include: | ||
:;Enumeration is complete | :;Enumeration is complete | ||
::that is, there are no more clipboard formats available. | ::that is, there are no more clipboard formats available. | ||
:;Other | :;Other | ||
::Index of the next available clipboard-data format in the clipboard. | ::Index of the next available clipboard-data format in the clipboard. | ||
==Remarks== | ==Remarks== | ||
The clipboard should be open before this function is used. | The clipboard should be open before this function is used. | ||
==Example Code== | ==Example Code== | ||
This example enumerates and counts the available clipboard data formats for the clipboard opened by WinOpenClipbrd. | This example enumerates and counts the available clipboard data formats for the clipboard opened by [[WinOpenClipbrd]]. | ||
<pre> | <pre> | ||
#define INCL_WINCLIPBOARD /* Window Clipboard Functions */ | #define INCL_WINCLIPBOARD /* Window Clipboard Functions */ | ||
Line 49: | Line 46: | ||
} | } | ||
} | } | ||
</pre> | </pre> | ||
Latest revision as of 14:23, 8 August 2024
This function enumerates the list of clipboard data formats available in the clipboard.
Syntax
WinEnumClipbrdFmts(hab, fmt)
Parameters
- hab (HAB) - input
- Anchor-block handle.
- fmt (ULONG) - input
- Previous clipboard-data format index.
- Specifies the index of the last clipboard data format enumerated using this function.
- This should start at zero, in which instance the first available format is obtained. Subsequently, it should be set to the last format index value returned by this function.
Returns
- ulNext (ULONG) - returns
- Next clipboard-data format index.
- Possible values include:
- Enumeration is complete
- that is, there are no more clipboard formats available.
- Other
- Index of the next available clipboard-data format in the clipboard.
Remarks
The clipboard should be open before this function is used.
Example Code
This example enumerates and counts the available clipboard data formats for the clipboard opened by WinOpenClipbrd.
#define INCL_WINCLIPBOARD /* Window Clipboard Functions */ #include <os2.h> BOOL fSuccess; /* success indicator */ HAB hab; /* anchor-block handle */ ULONG ulNext; /* next format index */ ULONG ulPrev; /* previous format index */ ULONG ulNumFormats=0; /* number of available formats */ fSuccess = WinOpenClipbrd(hab); if (fSuccess) { ulPrev = 0; /* enumerate formats and maintain count */ while ((ulNext = WinEnumClipbrdFmts(hab, ulPrev)) != 0) { ulNumFormats++; ulPrev = ulNext; } }