Advertisement
maskofa

Capture Form

Aug 11th, 2021
1,484
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.53 KB | None | 0 0
  1. procedure TfrmUtama.FormKeyDown(Sender: TObject; var Key: Word; Shift:
  2.     TShiftState);
  3. var
  4.   bm: TBitmap;
  5. begin
  6.   //close crtl + x;
  7.   if (ssCtrl in Shift) and (Key = 88) then
  8.   Close;
  9.  
  10.   //capture form ctrl + C;
  11.   if (ssCtrl in Shift) and (Key = 67) then
  12.   begin
  13.     bm := TBitmap.Create;
  14.     try
  15.       bm.SetSize(ClientWidth, ClientHeight);
  16.       BitBlt(bm.Canvas.Handle, 0, 0, ClientWidth, ClientHeight,
  17.       Canvas.Handle, 0, 0, SRCCOPY);
  18.       Clipboard.Assign(bm);
  19.     finally
  20.       bm.Free;
  21.     end;
  22.   end;
  23. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement