Disable the close button of your form  

Send By: Radikal (Q3 Team)
Web : http://www.q3.nu
Email: radikal@q3.nu
Date: 20/11/99

Tip accessed 506 times

 


Simply, put this code in the OnCreate event of your form:


 procedure TForm1.FormCreate(Sender: TObject);
 var
   hMenuHandle : HMENU;
   i:Integer;
 begin
   hMenuHandle := GetSystemMenu(handle, FALSE);
   if (hMenuHandle <> 0) then begin
     DeleteMenu(hMenuHandle, SC_CLOSE, MF_BYCOMMAND);
     i := GetMenuItemCount(hMenuHandle)-1;
     if i > -1 then
       DeleteMenu(hMenuHandle,i,MF_BYPOSITION);
   end;
 end;