1 unit unit1;
2
3 Interface
4
5 uses
6 windows, messages, sysutils, variants, classes, graphics, controls, forms,
7 dialogs, stdctrls;
8
9 type
10 tform1 = Class (tform)
11 button1: tbutton;
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 hwnd: thandle;
24 TMP: integer;
25
26
27 Implementation
28
29 {$ R *. DFM}
30
31 Procedure tform1.button1click (Sender: tobject );
32 begin
33 hwnd: = findwindow ('Shell _ traywnd', nil );
34 if hwnd <> 0 then showwindow (hwnd, sw_hide); // hide the taskbar
35 systemparametersinfo (spi_screensaverrunning, 1, @ TMP, 0); // shield system hotkeys
36 Height: = screen. height;
37 width: = screen. width;
38 position: = poscreencenter;
39 end;
40
41 procedure tform1.button2click (Sender: tobject );
42 begin
43 hwnd: = findwindow ('Shell _ traywnd', nil );
44 showwindow (hwnd, sw_show); // restore the taskbar
45 systemparametersinfo (spi_screensaverrunning, 0, @ TMP, 0); // restore the system hotkey
46 Height: = screen. Height-50;
47 width: = screen. width;
48 position: = poscreencenter;
49 end;
50
51
52
53 end.