Disable the START button on the taskbar  

Send By: Q3 Team
Web : www.q3.nu
Email: dlib@q3.nu
Date: 26/05/20

Tip accessed 1036 times

 



 procedure TForm1.Button3Click(Sender: TObject);
 begin
  {Disable the start button}
   EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil),
                                        0,
                                        'Button',
                                        nil),
                                        false);
 end;



To enable it again:


 procedure TForm1.Button4Click(Sender: TObject);
 begin
   {Enable the start button}
    EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil),
                                         0,
                                         'Button',
                                         nil),
                                         true);
 end;





Sent by: labgalia

For a more drastic disabling, you can use these procedures:

NOTE: Add Registry in the uses line


 procedure DesactivaBotonInicio;
 var
   Reg           : TRegistry;
 begin
   Reg :=TRegistry.Create;
   try
     Reg.RootKey := HKEY_CLASSES_ROOT;
     Reg.MoveKey( '\CLSID\{5b4dae26-b807-11d0-9815-00c04fd91972}',
                  '\CLSID\{-5b4dae26-b807-11d0-9815-00c04fd91972}',TRUE);
   finally
     Reg.Free;
   end;
 end;




 procedure ActivaBotonInicio;
 var
   Reg           : TRegistry;
 begin
   Reg :=TRegistry.Create;
   try
     Reg.RootKey := HKEY_CLASSES_ROOT;
     Reg.MoveKey( '\CLSID\{-5b4dae26-b807-11d0-9815-00c04fd91972}',
                  '\CLSID\{5b4dae26-b807-11d0-9815-00c04fd91972}',TRUE);
   finally
     Reg.Free;
   end;
 end;



Important: Is neccesary restart the user session (or the Windows) for make work the procedures


Updated at 26/05/2005 labgalia version