1
2 unit Unit1;
3
4 interface
5
6 uses
7 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
8 Dialogs, StdCtrls;
9
10 type
11 TForm1 = class(TForm)
12 Button2: TButton;
13 procedure Button1Click(Sender: TObject);
14 procedure Button2Click(Sender: TObject);
15 private
16 { Private declarations }
17 public
18 { Public declarations }
19 end;
20
21 var
22 Form1: TForm1;
23
24 implementation
25
26 {$R *.dfm}
27
28
29
30 procedure TForm1.Button2Click(Sender: TObject);
31 var
32 DeskTopDC: HDc;
33 DeskTopCanvas: TCanvas;
34 DeskTopRect: TRect;
35 begin
36 DeskTopDC := GetWindowDC(GetDeskTopWindow);
37 DeskTopCanvas := TCanvas.Create;
38 DeskTopCanvas.Handle := DeskTopDC;
39 DeskTopRect := Rect(0, 0, Screen.Width, Screen.Height);
40 Form1.Canvas.CopyRect(DeskTopRect, DeskTopCanvas, DeskTopRect);
41 ReleaseDC(GetDeskTopWindow, DeskTopDC);
42 end;
43
44 end.
45
|