Disabling Ctrl-Alt-Del

 

Your program might require to disable Ctrl-Alt-Del key sequense, for example if you don't want your program to be unloaded from memory. It is possible by using the SystemParametersInfo API function. This function is used by Control Panel and allows to know or to set parameters of operating system, such as keyboard, display, sound settings, etc. In other words, it is used to customize Windows environment. Its syntax is like the following:

BOOL SystemParametersInfo(
UINT uiAction,	// system parameter to query or set
UINT uiParam,	// depends on action to be taken
PVOID pvParam,	// depends on action to be taken
UINT fWinIni    // user profile update flag
);

The meaning of each parameter is described in Win32 Developer's Reference (kbase.hlp).
Now, to do what we want, we must call this function like in the following procedure:

procedure DisableCtrlAltDel;
var
  i : integer;
begin
  i := 0;
  {Disable Ctrl-Alt-Del}
  SystemParametersInfo( SPI_SCREENSAVERRUNNING, 1, @i, 0);
end.

Don't forget to place WinProcs unit in "uses " clause of your unit.

Remark: To disable Alt-Tab sequense you must use the first parameter SPI_SETFASTTASKSWITCH and others are the same as above.