Clipboard Copy-Paste doesn't work in a service on Win Server 2008/Vista 64bit -
Update: This problem has been solved.
You can read about the solution here:
Hi,
I used to send images from Word documents I'm trying to use the clipboard API (in Delphi) to remove. My code works fine in Windows XP / 2003, but this does not work in Windows 2008 64bit. In the win 2008, I get an error saying that the clipboard format is empty and there is no format in it.
The image is being copied to the clipboard (I can see it in the clipboard via Word) but when I try to ask the clipboard what format it is in, then it has said that 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');
is
Thanks in advance, Iya
Air Force, revealed that M $ does not allow services to interact with the desktop (which is necessary to use the clipboard) in Win2008.
Comments
Post a Comment