![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|
Q: Disable the CTRL-ALT-DEL dialog on Windows 95/98AnswerCall the SystemParametersInfo API function and fool the OS into thinking that the screen saver is running. When the screen saver is running, the OS does not activate the CTRL-ALT-DEL dialog. __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { // Disable CTRL-ALT-DEL construction SystemParametersInfo(SPI_SCREENSAVERRUNNING, TRUE , NULL,0); } __fastcall TForm1::~TForm1() { // Enabled CTRL-ALT-DEL when we close SystemParametersInfo(SPI_SCREENSAVERRUNNING, FALSE , NULL,0); } Note: Only disable the CTRL-ALT-DEL window if it is absolutely necessary. If your program crashes, the destructor for your form may not run, which would leave the CTRL-ALT-DEL dialog disabled until your user reboots the machine. Note: The SystemParametersInfo trick does not work on Windows NT. | ||||||
All rights reserved. |