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 Button1: TButton;
13 procedure Button1Click(Sender: TObject);
14 private
15 { Private declarations }
16 public
17 function IsActiveDeskTopOn:Boolean;
18 { Public declarations }
19 end;
20
21 var
22 Form1: TForm1;
23
24 implementation
25
26 {$R *.dfm}
27 function TForm1.IsActiveDeskTopOn:Boolean;
28 var
29 Hd: HWND;
30 begin
31 Result := False;
32 Hd := FindWindow( Pchar('Progman'), nil);
33 Hd := FindWindowEx( hd, 0, 'SHELLDLL_DefView', nil);
34 Hd := FindWindowEx( hd, 0, 'Internet Explorer_Server', nil);
35 if hd = 0 then
36 Result := False
37 else
38 Result := True;
39 end;
40
41
42
43 procedure TForm1.Button1Click(Sender: TObject);
44 begin
45 if IsActiveDeskTopOn then
46 showmessage('Active Desktop is ON')
47 else
48 showmessage('Active Desktop is OFF');
49 end;
50
51 end.
52
|