Show/Hide the "Start" button (Views: 29)
Problem/Question/Abstract: Show/Hide the "Start" button Answer: Solve 1: 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 } Solve 2: To show: EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil), TRUE); To hide: EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil), FALSE); |