Clipboard Copy-Paste doesn't work on Win Server 2008/Vista 64bit -
I'm trying to use the clipboard API (Delphi) to remove images from Word documents. My code works fine in Windows XP / 2003, but Windows 2008 64-bit Win 2008 does not work I empty Klipboardkformet that get an error saying it does not have any format.
being copied image to the clipboard (I think it'll be looking at the clipboard through the Word), but when I got into it what format that would try to ask the clipboard, he said There is no format in it.
How can I use the clipboard program when I win 2008 / Vista? What I know about 64 bit since 2008, this can be a security problem ...
Here is the code snippet:
In this way I can copy this image I'm trying to clipboard:
W.ActiveDocument.InlineShapes.Item (1). Choose; // W. A word object linking and embedding object is Wselection.Copy;
And so on, I try to paste it.
clipboard. open; Write2DebugFile ('FormatCount =' + IntToStr (clipboard formattack)); // FormatCount = 0 for JJ: = 1 type Lia.formetkount to clipboard 2DebugFile ( '#' + Intotostr (JJ) + ':' + IntToStr (clipboard. Format [JJ])); If (clipboard. HSFormat (CF_BITMAP)) or (clipboard. HSFormat (CF_PICTURE)) or (clipboard. HASFormat (CF_METAFILEPICT)) so / All HasFormat Call Begin returns FALSE JPEG: = TJPEGImage.Create; Bitmap: = TBitmap Create; Bitmap.LoadFromClipboardFormat (cf_BitMap, ClipBoard.GetAsHandle (cf_Bitmap), 0); Jpeg.Assign (bitmap); Jpeg.SaveToFile (JpgFileN); Try Jpeg.Free; Except; End; ResizeImage (JpgFileN, 750); Write2DebugFile ('saving' + JpgFileN); End and Write2DebugFile ('Not the correct format');
Thanks in advance, Iya
So, your debug what Format list from output? And what is the delay between copying and pasting? You will definitely need some idle time between those snippets of code. That means you can not copy and then hope to be able to paste immediately.
Comments
Post a Comment