4

The LA Fox Developer Newsletter
April 1997
Undocumented Functions in
foxtools .fII
Part 3
Windows CliDboard Functions:

These functions map to the Windows SDK functions that are
similarly named. We strongly recommend that you don’t use
these unless you know exactly what you’re doing! The FoxPro
system variable _CLIPTEXT is the recommended way of ac-
cessing the Windows clipboard.


closeclip()
Description: Closes the clipboard opened previously with
openclip() Returns .T. if successful.
Example:
closeclip()
Returns: .T. Return Value: Logical

countclip()
Description: The countclip() function retrieves the number of
different data formats currently in the clipboard.
Example:
countclip()
Returns: 0
Return Value: Numeric

emptyclip()
Description: The emptyclip() function empties the clipboard and
frees handles to data in the clipboard. It then assigns ownership
of the clipboard to the window that currently has the clipboard
open.
Example:
emptyclip()
Returns: .F.
Return Value: Logical

enumclipfm(expN)
Description: The enumclipfm() function enumerates the formats
found in a list of available formats that belong to the clipboard.
Each call to this function specifies a known available format; the
function returns the format that appears next in the list.
Return Value: Numeric

getclipdat(expN)
Description: The getclipdatOGetClipDat function retrieves a
handle of the current clipboard data having a specified format in
expN. expN contains the following defines:
cf Text: 1
cf_Bitmap: 2
cf_MetaFilePict: 3
cf_SYLK: 4
cf_DIE: 5
cf_TIEE: 6
cfOEMText: 7
cf_DIB: 8
vcf_Palette: 9
Return Value: Logical

getclipfmt(expN)
Description: The GetClipFmt function retrieves the name of a
registered clipboard format.
Return Value: Character

isclipfmt(expN)
Description: Returns the format of the available contents of the
clipboard. expN is as follows:
cf_Text: I
cf_Bitmap: 2
cf_MetaFilePict: 3
cf_SYLK: 4
cf_DIF: 5
cf_TIFE: 6
cfOEMText: 7
cf_DIB: 8
vcf_Palette: 9
Example:
isclipfmt(cf_Text)
Returns: .T.
Return Value: Logical

openclip(expN)
Description: The openclip() function opens the clipboard. Other
applications will not be able to modify the clipboard until the
closeclip() function is called. expN lathe handle of the window -
o is acceptable Note: Almost all clip functions rely on opening
the clipboard prior to use.
Example:
openclip(O)
Returns: .T.
Return Value: Logical

regclipfmt(expC)
Description: The regclipfmt() function registers a new clipboard
format. The registered format can be used in subsequent
clipboard functions as a valid format in which to render data, and
it will appear in the clipboard’s list of formats. expC is a string
that names the new format.
Example:
regclipfmt("MyRegClip")
Return Value: Numeric
Note: The return value indicates the newly registered format. If
the identical format name has been registered before, even by a
different application, the format’s reference count is incremented
(increased by one) and the same value is returned as when the
format was originally registered. The return value is zero if the
format cannot be registered.

setclipdat(expN, expC)
Description: The setclipdat() function sets the data in the
clipboard.
Example:
setclipdat(1, “Test”)
(Con’t, page 8)
Page 4

4