Mega Code Archive

 
Categories / Delphi / Examples
 

Show- hide the start button

The following procedure hides or shows the start button: Procedure hideStartbutton (visi: boolean); Var Tray, Child : HWnd; c : Array [0..127] Of Char; s : String; Begin { hideStartButton } Tray := FindWindow ('Shell_TrayWnd', Nil); Child := GetWindow (Tray, GW_CHILD); While Child <> 0 Do Begin If GetClassName (Child, c, SizeOf (c)) > 0 Then Begin s := StrPas (c); If UpperCase (s) = 'BUTTON' Then Begin // IsWindowVisible(Child) startbutton_handle := Child; If visi Then ShowWindow (Child, 1) Else ShowWindow (Child, 0) End End; Child := GetWindow (Child, GW_HWNDNEXT) End End; { hideStartButton }