Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy Unicode to clipboard
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01414441
Message ID:
01414665
Views:
74
>I use the Sergey's code (http://www.berezniker.com/content/pages/visual-foxpro/copy-unicode-text-clipboard) to copy Chinese text to clipboard as follows.
CopyUnicodeText2Clipboard(StrConv(_Cliptext,5))
>When I paste the text into Excel, it is okay. However if I paste the text into VFP, the text becomes question marks.
>
>Is it possible to make it work in both applications (Excel & VFP)?

What do you have in clipboard before an after?
CLEAR

* Get list of files from Clipboard
DECLARE Long OpenClipboard IN USER32 Long hWndNewOwner
DECLARE Long CloseClipboard IN USER32
DECLARE Long EmptyClipboard IN USER32

DECLARE Long GetClipboardData IN USER32 Long lnFormat
DECLARE Long EnumClipboardFormats IN USER32 Long lnFormat

* open clipboard
lnResult = OpenClipboard(_SCREEN.hWnd)

*= EmptyClipboard()

* Enumerate the file formats in the clipboard.
* Helpful for testing, otherwise is not required.
lnFormat = 0
lnFormat = EnumClipboardFormats(lnFormat)
lnCntr = 1
DO WHILE lnFormat > 0
	? lnCntr, lnFormat
	lnCntr = lnCntr + 1
	lnFormat = EnumClipboardFormats(lnFormat)
ENDDO

= CloseClipboard()


* Predefined Clipboard Formats

#define CF_TEXT             1
#define CF_BITMAP           2
#define CF_METAFILEPICT     3
#define CF_SYLK             4
#define CF_DIF              5
#define CF_TIFF             6
#define CF_OEMTEXT          7
#define CF_DIB              8
#define CF_PALETTE          9
#define CF_PENDATA          10
#define CF_RIFF             11
#define CF_WAVE             12
#define CF_UNICODETEXT      13
#define CF_HDROP            15
#define CF_LOCALE           16
#define CF_MAX              17

#define CF_OWNERDISPLAY     0x0080
#define CF_DSPTEXT          0x0081
#define CF_DSPBITMAP        0x0082
#define CF_DSPMETAFILEPICT  0x0083
#define CF_DSPENHMETAFILE   0x008E
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform