procedure
TForm1.Button1Click(Sender: TObject);
var
DesktopHWnd: HWnd;
DesktopDC: HDc;
begin
Application.Minimize; //Réduit
l'application
Sleep(5000);//Attend 5 secondes
(en ms )
DesktopHWnd := GetDesktopWindow; //Retourne
le handle
DesktopDC := GetDC(DesktopHWnd); //Retourne
le handle du contexte d'affichage
Image1.Picture.Bitmap.Width:=Screen.Width; //Largeur
de l'écran
Image1.Picture.Bitmap.Height:=Screen.Height; //Hauteur
de l'écran
BitBlt(Image1.Picture.Bitmap.Canvas.Handle,0,0,
Screen.Width,Screen.Height,GetDC(GetDesktopWindow),
0,0,SrcCopy);
ReleaseDC(DesktopHWnd, DesktopDC);
Application.Restore; //Restaure
l'application
end; |