Note that there are some explanatory texts on larger screens.

plurals
  1. POClipboard Copy-Paste doesn't work in a service on Win Server 2008/Vista 64bit
    primarykey
    data
    text
    <p>Update: This issue has been resolved.</p> <p>you can read about the solution in here: <a href="https://stackoverflow.com/questions/2237696/creating-a-process-in-a-non-zero-session-from-a-service-in-windows-2008-server">Creating a process in a non-zero session from a service in windows-2008-server?</a></p> <p>Thanks everyone!</p> <hr> <p>Hi,</p> <p>I am trying to use Clipboard API (in Delphi) to extract images from Word documents. my code works OK in Windows XP/2003 but in windows 2008 64 bit it doesn't work. in win 2008 i get an error saying that Clipboard.Formats is empty and doesn't contain any format.</p> <p>The image seems to be copied to the Clipboard (i can see it in the clipboard via Word) but when i try to ask the clipboard what format does he have it said it doesn't have any formats. </p> <p>how can i access the clipboard programmatically on win 2008/Vista? from what i know of 2008 64 bit, it might be a security issue...</p> <p>here is the code snippet:</p> <p>This is how i am trying to copy the Image to the clipboard:</p> <pre><code>W.ActiveDocument.InlineShapes.Item(1).Select; // W is a word ole object W.Selection.Copy; </code></pre> <p>and this is how i try to paste it.</p> <pre><code> Clipboard.Open; Write2DebugFile('FormatCount = ' + IntToStr(Clipboard.FormatCount)); // FormatCount=0 For JJ := 1 to Clipboard.FormatCount Do Write2DebugFile('#'+ IntToStr(JJ) + ':' + IntToStr(Clipboard.Formats[JJ])); If (Clipboard.HasFormat(CF_BITMAP)) or (Clipboard.HasFormat(CF_PICTURE)) or (Clipboard.HasFormat(CF_METAFILEPICT)) then // all HasFormat calls returns false. Begin 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 else Write2DebugFile('Doesnt have the right format'); </code></pre> <p>Thanks in advance, Itay</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload