Copy Application Image To Clipboard lazarus / 39-Graphics ---------------------------------------------------------------------- Bazzao · 2019-06-22 03:16 I can copy a Form canvas to clipboard, but it does not include the header. How do I copy the Application as shown to the the clipboard (ie coding equivalent of Alt-Printscrn)? Bazza ---------------------------------------------------------------------- RAW · 2019-08-21 04:06 On Windows: Try this ... (found it in a german thread, seems to work even if the window is hidden, take a look at PrintWindow ... needs XP/Server 2003 or newer) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i UNIT Unit1;{$MODE DELPHI}INTERFACE USES  Windows,  Graphics,  Forms,  ExtCtrls; TYPE  TForm1 = Class(TForm)    Image1: TImage;    Procedure Image1Click(Sender: TObject);  End; Var  Form1: TForm1; IMPLEMENTATION{$R *.LFM} Function ScrShotWnd(wnd: HWND; Const bmp: TBitmap): Boolean;Var r: TRect; hDLL: THandle; PrintWindow: Function(aWnd: HWND; hDC: HDC; nFlags: UINT): BOOL; Stdcall;Begin  Result:= False;  hDLL:= GetModuleHandle(user32);  If hDLL <> 0  Then   Begin     @PrintWindow:= GetProcAddress(hDLL, 'PrintWindow');     If @PrintWindow <> Nil     Then      Begin        GetWindowRect(wnd, r);        bmp.Width := r.Right -r.Left;        bmp.Height:= r.Bottom-r.Top;        bmp.Canvas.Lock;        Try          Result:= PrintWindow(wnd, bmp.Canvas.Handle, 0);        Finally          bmp.Canvas.Unlock;        End;      End;   End;End; Procedure TForm1.Image1Click(Sender: TObject);Var Wnd: THandle;Begin  Wnd:= FindWindow('AkelPad4', Nil);  ScrShotWnd(Wnd, Image1.Picture.Bitmap);  Image1.Invalidate;  SetBounds(0, 0, Image1.Picture.Bitmap.Width, Image1.Picture.Bitmap.Height);End; END. ---------------------------------------------------------------------- RAW · 2019-08-21 05:06 Or this ... Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.FormClick(Sender: TObject);begin  KEYBD_Event(VK_SNAPSHOT, 1, 0, 0);end; ---------------------------------------------------------------------- Bazzao · 2019-08-22 08:50 I tried Quote KEYBD_Event(VK_SNAPSHOT, 1, 0, 0); and after adding the necessary uses, it worked first go. Very good RAW. Thanks,