Example CLIPBOARD.PRT
; CLIPBOARD
;
; Program for Proteus
;
; (C) 2004 Simone Zanella Productions
;
; This program enumerates the formats in the clipboard and print the contents (if it is representable as text).
; It also sets the clipboard to "Hello, world!" on exit.

#!proteus -z

CONST CF_TEXT             1
CONST CF_BITMAP           2
CONST CF_METAFILEPICT     3
CONST CF_SYLK             4
CONST CF_DIF              5
CONST CF_TIFF             6
CONST CF_OEMTEXT          7
CONST CF_DIB              8
CONST CF_PALETTE          9
CONST CF_PENDATA          10
CONST CF_RIFF             11
CONST CF_WAVE             12
CONST CF_UNICODETEXT      13
CONST CF_ENHMETAFILE      14
CONST CF_HDROP            15
CONST CF_LOCALE           16
CONST CF_MAX              17
CONST CF_OWNERDISPLAY     0x0080
CONST CF_DSPTEXT          0x0081
CONST CF_DSPBITMAP        0x0082
CONST CF_DSPMETAFILEPICT  0x0083
CONST CF_DSPENHMETAFILE   0x008E
CONST CF_PRIVATEFIRST     0x0200
CONST CF_PRIVATELAST      0x02FF
CONST CF_GDIOBJFIRST      0x0300
CONST CF_GDIOBJLAST       0x03FF

;ProteusSetClipboard(type, data)
;ProteusGetClipboardSize(type)
;ProteusGetClipboard(type)
;ProteusEnumClipboardFormats(lasttype)

!extern SetClipboard, PROTEXT.DLL, ProteusSetClipboard, 2, 0
!extern GetClipboardSize, PROTEXT.DLL, ProteusGetClipboardSize, 1, 0
!extern GetClipboard, PROTEXT.DLL, ProteusGetClipboard, 1, 32768
!extern EnumClipboardFormats, PROTEXT.DLL, ProteusEnumClipboardFormats, 1, 0

LASTTYPE = EnumClipboardFormats(0)
CONSOLELN "Formats for the clipboard:"
WHILE NEQ(LASTTYPE, 0)
  N = GetClipboardSize(LASTTYPE)
  CONSOLELN "-- Format: " LASTTYPE " (size " N " bytes)"
  IF EQ(LASTTYPE, CF_TEXT)
    CONSOLELN "---- Contents: " GetClipboard(LASTTYPE)
  FI
  LASTTYPE = EnumClipboardFormats(LASTTYPE)
LOOP

CONSOLELN "Setting clipboard to \"Hello, world!\".."
SetClipboard(CF_TEXT, "Hello, world!")
CONSOLELN "Done."

ABORT 0
Samples index Next example Previous example Contents Index
Midnight Lake iPhone Case Black Women Shoes Black Flat Shoes Leather Flats Black Patent Ballerinas Black Ballet Shoes Casual Shoes Black Shoes Women Balle Record Player Cufflinks Best iPhone XR Clear Cases iPhone XS/XS Max Leather Cases Sale Best iPhone 8/8 Plus Silicone Cases iPhone 7/7 Plus Cases & Screen Protector New Cases For iPhone 6/6 Plus iPhone 8 Case Sale iPhone Xr Case Online iPhone 7 Case UK Online iPhone X Case UK Sale iPhone X Case Deals iPhone Xs Case New Case For iPhone Xr UK Online Case For iPhone 8 UK Outlet Fashion Silver Cufflinks For Men Best Mens Cufflinks Outlet Online The Gold Cufflinks Shop Online Cheap Shirt Cufflinks On Sale Nice Wedding Cufflinks UK Online Top Black Cufflinks UK Online Mens Cufflinks Online Silver Cufflinks For Men Men Cufflinks UK Sale Gold Cufflinks UK Online Gold Cufflinks UK Silver Cufflinks UK Shirt Cufflinks Discount Online Mens Cufflinks Deals & Sales Girls Shoes For Dance Fashion Ballet Dance Shoes Best Ballet Flats Shoes UK Online Cheap Ballet Pointe Shoes UK Online Best Ballet Shoes Outlet Best Dance Shoes Sale Cheap Ballet Flats Sale UK Best Pointe Shoes Online UK Ballet Dance Shoes UK Shoes For Dance UK Best Ballet Slippers Shop Best Yoga Shoes Hotsell