Mega Code Archive

 
Categories / Delphi / Examples
 

Disabling and enabling of the start menu [start button]

The Windows start menu is opened by clicking on the start button which is just a windowed control as others on your desktop. Thus you can show or hide, enable or disable it. The key is to obtain the window handle of your start button. The code in the other example (see above 'Show/ Hide the Start button') is a bit long since it checks for errors. If you want to write real compact code, take a look at this one: procedure EnableStartbutton(bEnabled: Boolean); begin EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil) ,0 ,'Button' ,nil), bEnabled) end;