uLib
User mode C/C++ extended API library for Win32 programmers.
|
Supplementary clipboard APIs
Macros | |
#define | PutClipboardString PutClipboardStringA |
Typedefs | |
typedef bool(__stdcall * | PFClipFmtAction) (UINT FmtTag, PVOID UserData) |
Functions | |
bool | OpenEmptyClipboard (HWND hWnd) |
UINT | EnumerateClipFormats (HWND hCBOwner, PFClipFmtAction Action, PVOID UserData) |
bool | PutClipHandle (HWND clipboardOwner, HANDLE hClip, UINT clipFmt) |
HANDLE | GetClipHandle (UINT clipFmt) |
bool | PutClipboardStringA (HWND clipboardOwner, ACSTR Text) |
bool | PutClipboardStringW (HWND clipboardOwner, WCSTR Text) |
CSTR | DupClipboardString () |
PVOID | DupClipboardData (UINT clipFmt, PUINT pSize OPTOUT) |
#define PutClipboardString PutClipboardStringA |
Definition at line 1008 of file UtilFunc.h.
typedef bool(__stdcall * PFClipFmtAction) (UINT FmtTag, PVOID UserData) |
PFClipFmtAction is the callback for EnumerateClipFormats().
The callback is invoked with the clipboard open for reading.
Return true to continue the enumeration.
Definition at line 976 of file UtilFunc.h.
bool OpenEmptyClipboard | ( | HWND | hWnd | ) |
OpenEmptyClipboard opens and clears the clipboard for writing.
Note: If hWnd is NULL, EmptyClipboard() sets the clipboard owner to NULL,
which causes any subsequent SetClipboardData() to fail.
Definition at line 48 of file UserUtil.cpp.
UINT EnumerateClipFormats | ( | HWND | hCBOwner, |
PFClipFmtAction | Action, | ||
PVOID | UserData | ||
) |
EnumerateClipFormats is much less cumbersome than EnumClipboardFormats().
It returns the count of formats actually sent to the callback.
Definition at line 55 of file UserUtil.cpp.
bool PutClipHandle | ( | HWND | clipboardOwner, |
HANDLE | hClip, | ||
UINT | clipFmt | ||
) |
PutClipHandle puts a handle (i.e it's data) on the clipboard.
After a successful call, the clipboard gains ownership of hClip.
Note: If clipboardOwner is NULL, PutClipHandle will fail.
See also OpenEmptyClipboard().
Definition at line 73 of file UserUtil.cpp.
HANDLE GetClipHandle | ( | UINT | clipFmt | ) |
GetClipHandle gets a data handle from the clipboard.
Note: The system clipboard still owns the handle!
Definition at line 85 of file UserUtil.cpp.
bool PutClipboardStringA | ( | HWND | clipboardOwner, |
ACSTR | Text | ||
) |
PutClipboardString copies a string to the clipboard.
Note: For multi-line text, CRLF line endings are mandated by the clipboard
(due to it's auto-conversion to synthesized text formats).
See also PutClipHandle().
Definition at line 111 of file UserUtil.cpp.
bool PutClipboardStringW | ( | HWND | clipboardOwner, |
WCSTR | Text | ||
) |
Definition at line 117 of file UserUtil.cpp.
CSTR DupClipboardString | ( | ) |
DupClipboardString duplicates a string from the clipboard.
Free the string with GlobalFree() when done.
Definition at line 123 of file UserUtil.cpp.
PVOID DupClipboardData | ( | UINT | clipFmt, |
PUINT pSize | OPTOUT | ||
) |
DupClipboardData duplicates a specific data format from the clipboard.
Free the data with GlobalFree() when done.
Note: The size returned to pSize might be larger than the actual clip size, due to GlobalAlloc implementation details.
Definition at line 139 of file UserUtil.cpp.