Question and Answer Database FAQ1313D.txt Disabling the Win95 start button Category :Windows API Platform :All Product :All 32 bit Question: How do I hide and disable the Win95 start button? Answer: The following example both hides and unhides the Windows start button, and also enables and disables the start button. Example: procedure TForm1.Button1Click(Sender: TObject); var Rgn : hRgn; begin {Hide the start button} Rgn := CreateRectRgn(0, 0, 0, 0); SetWindowRgn(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil), Rgn, true); end; procedure TForm1.Button2Click(Sender: TObject); begin {Turn the start button back on} SetWindowRgn(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil), 0, true); end; procedure TForm1.Button3Click(Sender: TObject); begin {Disable the start button} EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil), false); end; procedure TForm1.Button4Click(Sender: TObject); begin {Enable the start button} EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil), true); end 7/16/98 4:31:28 PM
Last Modified: 01-SEP-99