Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is Clipboard empty?
Message
 
 
To
10/04/2009 15:11:45
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Miscellaneous
Thread ID:
01394105
Message ID:
01394216
Views:
52
Hi Koen,

You've to understand first how Windows clipboard works. Follow the link at the beginning of my article and read up on the Windows clipboard.
In short, the clipboard can hold data in multiple formats at the same time. The EnumClipboardFormats() will tell you in what formats data is present on clipboard. As long as EnumClipboardFormats() returns value > 0 on the first call, the clipboard is not empty but it doesn't mean that it has what you need.
The GetClipboardData() retrieves data in specific format from the clipboard. The format 15 in particular, is the list of files. It's obvious that it wouldn't be present when you copy an image to clipboard.



>
>I have done:
>
>lnResult = openclipboard(_screen.hWnd)
>
>debugger shows lnResult = 1
>
>lnFormat = 0
>lnFormat = EnumClipboardFormats(lnFormat)
>lnCntr = 1
>DO WHILE lnFormat > 0
>
>ENDDO
>
>debugger show in loop:
>
>lnCntr = 2
>lnFormat = 8
>lnCntr = 3
>lnFormat = 17
>lnCtr = 4
>lnFormat = 0
>
>lnHdrop = GetClipboardData (15)
>
>lnHdrop gives 0
>
>Clipboard is definitely not empty: C&P in msPaint gives correct result
>
>This is of course very good, but I would like to get a different result as would like to use this procedure in my errorhandler now the lnHdrop gives a 0 value regardless if clipboard has data or nodata.
>Would you be able to give me a hint to catch the fact the clipboard has no data?
>
>Thanks for replying.
>
>Koen
>
>
>
>ln
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform