Author: William Gerbert
Show/Hide the "Start" button
Answer:
Solve 1:
1
2 The following procedure hides or shows the start button:
3
4 procedure hideStartbutton(visi: boolean);
5 var
6 Tray,Child: HWnd;
7 c: array[0..127] of Char;
8 s: string;
9 begin { hideStartButton }
10 Tray := FindWindow('Shell_TrayWnd', nil);
11 Child := GetWindow(Tray, GW_CHILD);
12 while Child <> 0 do
13 begin
14 if GetClassName(Child, c, SizeOf(c)) > 0 then
15 begin
16 s := StrPas(c);
17 if UpperCase(s) = 'BUTTON' then
18 begin
19 // IsWindowVisible(Child)
20 startbutton_handle := Child;
21 if visi then
22 ShowWindow(Child, 1)
23 else
24 ShowWindow(Child, 0)
25 end
26 end;
27 Child := GetWindow(Child, GW_HWNDNEXT)
28 end
29 end; { hideStartButton }
Solve 2:
To show:
30
31 EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil),
32 TRUE);
33
34 to hide:
35
36 EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil),
37 FALSE);
|