Plasmax
asked on
clipboard.dcu not found
I have search for this and i am unable to get my code right.
it needs to copy the clipboard contents for
1. text and show in memo
2. picture and show in image
but clipboard is never allowed, even if I add it to the dam uses.
it needs to copy the clipboard contents for
1. text and show in memo
2. picture and show in image
but clipboard is never allowed, even if I add it to the dam uses.
{
Place Timage and Tmemo on the form.
Retrieve what is in the clipboard. If it is image, it will be placed in Image1, and if text - in Memo1.
}
uses Clipboard;
...
procedure TForm1.Button1Click(Sender: TObject);
var
MyHandle: THandle;
begin
Clipboard.Open;
if Clipboard.HasFormat(CF_TEXT) then
begin
MyHandle:=Clipboard.GetAsHandle(CF_TEXT);
Memo1.Lines.Add(StrPas(GlobalLock(MyHandle)));
GlobalUnlock(MyHandle);
end;
if (Clipboard.HasFormat(CF_BITMAP)) or
(Clipboard.HasFormat(CF_PICTURE)) then
Image1.Picture.Assign(Clipboard);
Clipboard.Close;
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
a unit name and type name must be different in delphi
ASKER