Returns the contents of the Windows clipboard in a specified format.
ClipGetEx(format)
(i) format: format in which the text is returned. See below.
(s) contents: clipboard contents.
This function is similar to ClipGet, but it allows to you specify the format in which the text is returned. Valid formats are:
Format |
Meaning |
1 |
(CF_TEXT) Standard ANSI text (same as ClipGet). |
7 |
(CF_OEMTEXT) Text containing characters in the OEM character set. |
13 |
(CF_UNICODETEXT) Unicode text format (32-bit version under Windows NT only) |
Note: If the Clipboard contains an excessively large string a (fatal) out of memory error may occur.
;Format 1 example ClipPut("abc") ClipAppend("def") a=ClipGetEx(1) Display(3, "ClipGetEx using Format 1 Returns:", a) Exit ;Format 7 example Run(Environment("ComSpec"), "") ClipPut(StrCat("dir", Num2Char(13))) WinActivate("MS-DOS Prompt") SendKeysTo("MS-DOS Prompt","!{sp}EP") TimeDelay(15) SendKeysTo("MS-DOS Prompt","!{sp}Ek") ;to mark the position SendKeysTo("~MS-DOS Prompt", "+{RIGHT 60}+{DOWN 24}") SendKeysTo("~MS-DOS Prompt","!{sp}Ey{ENTER}") ;copy to clipboard SendKeysTo("~MS-DOS Prompt","exit{ENTER}") a=ClipGetEx(7) Display(3, "ClipGetEx using Format 7 Returns:", a) Exit ;Format 13 example ;NOTE: Unable to test ClipGetEx(13) (Unicode text format) under Window95--only under NT If WinMetrics(-4) == 4 ClipPut("abc") ClipAppend("def") a=ClipGetEx(13) Display(3, "ClipGetEx using Format 13 Returns:", a) EndIf Exit