9#if !defined(OWL_CLIPBOAR_H)
13#if defined(BI_HAS_PRAGMA_ONCE)
44 operator bool()
const;
60#if defined(__OLE_H) || defined(_INC_OLE)
62 OLEOPT_RENDER renderopt= olerender_draw,
63 OLECLIPFORMAT format = 0);
65 bool QueryCreate(
const tstring& protocol, OLEOPT_RENDER renderopt = olerender_draw, OLECLIPFORMAT format = 0)
66 {
return QueryCreate(protocol.c_str(), renderopt, format);}
69 OLEOPT_RENDER renderopt= olerender_draw,
70 OLECLIPFORMAT format = 0);
72 bool QueryLink(
const tstring& protocol, OLEOPT_RENDER renderopt = olerender_draw, OLECLIPFORMAT format = 0)
73 {
return QueryLink(protocol.c_str(), renderopt, format);}
98 static void Raise(
uint resourceId = IDS_CLIPBOARDBUSY);
113 uint operator ++(
int);
139inline TClipboard::operator bool()
const {
174 return ::GetClipboardData(Format);
183 return ::GetOpenClipboardWindow();
191 return ::GetClipboardOwner();
199 return ::GetClipboardViewer();
209 return ::GetClipboardFormatName(Format, FormatName, MaxCount);
218 return ::GetPriorityClipboardFormat(priorityList, count);
225 return ::CountClipboardFormats();
248 return ::IsClipboardFormatAvailable(format);
256 return ::EmptyClipboard();
267 return ::RegisterClipboardFormat(formatName.c_str());
283 return ::SetClipboardData(Format,Handle);
291 return ::SetClipboardViewer(Wnd);
294#if defined(__OLE_H) || defined(_INC_OLE)
308inline bool TClipboard::QueryCreate(
310 OLEOPT_RENDER renderopt,
314 return ::OleQueryCreateFromClip(protocol, renderopt, format) == OLE_OK;
326inline bool TClipboard::QueryLink(
328 OLEOPT_RENDER renderopt,
332 return ::OleQueryLinkFromClip(protocol, renderopt, format) == OLE_OK;
348inline TClipboardFormatIterator::operator
void* () {
349 return _Current ? this :
nullptr;
The clipboard class encapsulates the methods for the clipboard object of Windows.
HWND GetClipboardViewer() const
Retrieves the handle of the first window in the Clipboard-view chain.
int GetClipboardFormatName(uint format, TCHAR *formatName, int maxCount) const
Retrieves the name of the registered format specified by format and copies the format to the buffer p...
int GetPriorityClipboardFormat(uint *priorityList, int count) const
Returns the first Clipboard format in a list.
static LPCTSTR DefaultProtocol
Points to a string that specifies the name of the protocol the client needs.
HANDLE SetClipboardData(uint format, HANDLE handle)
Copy the data onto the clipboard in the format.
HWND SetClipboardViewer(HWND hWnd) const
Adds the window specified by Wnd to the chain of windows that WM_DRAWCLIPBOARD notifies whenever the ...
HWND GetOpenClipboardWindow() const
Retrieves the handle of the window that currently has the Clipboard open.
int CountClipboardFormats() const
Returns a count of the number of types of data formats the Clipboard can use.
bool OpenClipboard(HWND hWnd)
Opens the Clipboard and associates it with the window specified in Wnd.
TClipboard(HWND hWnd, bool mustOpen=true)
Constructs a clipboard object to grab the clipboard given a window handle.
bool IsClipboardFormatAvailable(uint format) const
Indicates if the format specified in format exists for use in the Clipboard.
HWND GetClipboardOwner() const
Retrieves the handle of the window that currently owns the Clipboard, otherwise returns NULL.
bool EmptyClipboard()
Clears the Clipboard and frees any handles to the Clipboard's data.
void CloseClipboard()
If the Clipboard is opened (IsOpen is true), closes the Clipboard.
HANDLE GetClipboardData(uint format) const
Retrieves data from the Clipboard in the format specified by format.The following formats are support...
uint RegisterClipboardFormat(const tstring &formatName) const
Registers a new Clipboard format.
static void Raise(uint resourceId=IDS_CLIPBOARDBUSY)
Throw the exception.
TXClipboard(uint resourceId=IDS_CLIPBOARDBUSY)
Create the TXClipboard exception with a string resource.
void Throw()
Throw the exception.
TXOwl(const tstring &msg, uint resId=0)
An OWL exception with a given message for displaying and an unsigned Id that can be used for identifi...
Object Windows Library (OWLNext Core).
General definitions used by all ObjectWindows programs.
ObjectWindows exception class & function definitions.