Myprogram copies to the clipboard, then when a user tries to paste from the
clipboard to Publisher they get the following error message:
'The clipboard is busy'

procedure TCamForm.ClipCopyPaste(Tval: Integer);
var bitmap: tbitmap;
begin
  bitmap := Tbitmap.Create;
  try
  if tval = 0 then //copy to clipboard FROM HERE
  begin
    bitmap.Width := FIMG1.Bmp.Width;
    bitmap.Height := FIMG1.Bmp.Height;
    FIMG1.bmp.draw(bitmap.Canvas.Handle, 0, 0);
    clipboard.Assign(bitmap);// TO HERE
  end
  else if (tval = 1) and (Clipboard.HasFormat(CF_BITMAP)) then //paste from
clipboard
  begin
    bitmap.assign(clipboard);
    insertPic(SizeFunc(bitmap));
    PicClick(ADbmpc.Bitmaps.Count);
  end;
  finally bitmap.Free;
end;

I have seen the following code:
    H := Clipboard.GetAsHandle(CF_TEXT);
    Len := GlobalSize(H)+1;
    P := GlobalLock(H);
    Memo1.SetTextBuf(P);
    GlobalUnlock(H);

Should I be doing something similar to above to force an unlock on the
clipboard, and also set the size allocation for the clipboard too - BTW I
havent seen anything in my references about 'clipboard sharing'
Thanks,
Alistair+

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to