Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Retrieving names for the registered clipboard formats
How to get the path to a Special Folder
How to remove FTP directory
Opening access to the Microsoft Internet functions for the application
Retrieving default spooling directory name
Retrieving geometrical parameters of the system desktop window
String representation for disk or memory capacity
Winsock: how to retrieve a service information corresponding to a port
Displaying the color palette stored in an image file
GDI+: rotating images using matrix transformations
How to create a service object
List of addresses in the AutoDial mapping database
Quering waveform-audio output devices
Validating URLs using moniker functions
Converting characters to upper or lower case
CryptoAPI: retrieving list of providers
Current System information
Determining whether or not the system is connected to the Internet
Listing device drivers in the system: load addresses, names
Retrieving information about MS-DOS device names using QueryDosDevice (WinNT only)
Retrieving the name of the network resource associated with a local device
Using GetSysColor
GDI+: printing vertical text on VFP reports via generated images (VFP9)
Pocket PC: enumerating mounted database volumes and databases in the Object Store
Retrieving names for the registered clipboard formats

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
DO decl

LOCAL lcBuffer, lnResult, hFormat, ii, lcName
#DEFINE cmBufsize  250

* registering a new format
hFormat = RegisterClipboardFormat ("NewlyRegisteredFormat")
? "New format registered:", hFormat

CREATE CURSOR csResult (id N(6), name C(250))

* Registered clipboard formats are identified by values 
* in the range 0xC000 through 0xFFFF

FOR ii=49152 TO 65535
    lcBuffer = Repli(Chr(0), cmBufsize)
    lnResult = GetClipboardFormatName (ii, @lcBuffer, cmBufsize)

    IF lnResult <> 0
        lcName = Left(lcBuffer, lnResult)
        INSERT INTO csResult VALUES (ii, lcName)

IF hFormat <> 0
    LOCATE ALL FOR id = hFormat
    GO TOP

    DECLARE INTEGER GetClipboardFormatName IN user32;
        INTEGER format, STRING @lpszFormatName,;
        INTEGER cchMaxCount

    DECLARE INTEGER RegisterClipboardFormat IN user32;
        STRING lpszFormat

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
910 bytes  
Created: 2002-01-27 13:08:13  
Modified: 2002-01-27 13:23:18  
Visits in 7 days: 38  
Listed functions:
Printer friendly API declarations
My comment:
Registered clipboard formats are identified by values in the range 0xC000 through 0xFFFF.

Under my WinMe system this example returns valid names as long as some garbage. Or it just seems like a garbage for me? After all this is another system nook where something can be stored until next reboot or shutdown.

The RegisterClipboardFormat is one-way road -- from a given name to a number within the [0xC000..0xFFFF] range. Though it takes no time to scan the range to define whether a cliboard format name is already registered.
Word Index links for this example:
Translate this page:
  Spanish    Portuguese    German    French    Italian offers instant, free translations of text or web pages.
User Contributed Notes:
There are no notes on this subject.

Copyright 2001-2018 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.39), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (
15 sec.Function: 'GdipGetSmoothingMode'
Function group: 'GDI+ Graphics'
28 sec.
Function group: 'GDI+'
41 sec.Function: 'Shell_NotifyIcon'
Function group: 'Shell Functions'
52 sec.Function: 'CryptCreateHash'
Function group: 'Cryptography Reference'
1.1 min.Function: 'AVIFileWriteData'
Function group: 'Windows Multimedia'
1.3 min.Function: 'GetFileSizeEx'
Function group: 'File System'
1.47 min.Function: 'GdipBitmapGetPixel'
Function group: 'GDI+ Bitmap'
1.85 min.
2.07 min.Function: 'SCardListCards'
Function group: 'Authentication'
2.3 min.Function: 'mciSendCommand'
Function group: 'Windows Multimedia'
Advertise here!