This example shows how a window views the clipboard contents.

#define INCL_WINCLIPBOARD
#include <OS2.H>
ULONG hclipbrdData;
HAB hab;                 /* anchor-block handle. */
HBITMAP bmap;            /* bit-map handle.      */
HWND hwnd;

WinOpenClipbrd(hab);
WinSetClipbrdViewer(hab,
                   hwnd); /* window handle of the clipboard */
                          /* viewer.                        */
hclipbrdData = WinQueryClipbrdData(hab,
                                   CF_TEXT);
WinCloseClipbrd(hab);


[Back] [Next]