Disabling Alt+F4 in Windows...? lazarus / 13-General ---------------------------------------------------------------------- martintzvetomirov · 2006-03-30 18:19 How to disable closing of an application by Alt+F4 under Windows? ---------------------------------------------------------------------- arrow · 2006-03-30 20:06 Quote from: "martintzvetomirov"How to disable closing of an application by Alt+F4 under Windows? Hi, you have to overload the KeyDownBeforeInterface-Procedure in your form with the following code: Code: [Select]   {[Alt]+[F4] Pressed?}   if (Key = VK_F4) and (Shift = [ssAlt]) then     {Remove Keycode...}     Key := 0;   inherited KeyDownBeforeInterface(Key, Shift); Maybe you have to include the Windows-Unit in your uses-clause cuz of the VK_F4 constant. Greetz, arrow ---------------------------------------------------------------------- mattias · 2006-03-30 20:56 The VK_F4 is defined in the LCLType and the platform independent way to stop closing is to set OnCloseQuery event of each form, that should not be closed. ---------------------------------------------------------------------- martintzvetomirov · 2006-03-31 08:06 10x