Disable / enable Start button
Just one line of code using EnableWindow function will do the trick. In our example, it’s made as an OnClick event of standard button. Just change the last parameter of the function to true and the Start button is enabled again
1 2 3 4 5 6 7 8 9 |
procedure TForm1.DeactivateStartButtonClick(Sender: TObject); begin EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil), false); end; procedure TForm1.ActivateStartButtonClick(Sender: TObject); begin EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil), true); end; |
Remember that start button key on your keyboard is still working even if you disable Start button itself, so Start menu is still accessible.