Preventing Windows shut down

前端 未结 7 570
梦毁少年i
梦毁少年i 2021-01-18 09:14

To detect and prevent shutdown the computer I use very simple program. It has only one form and one private procedure like below:

TForm3 = class(TForm)
priva         


        
7条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-18 09:51

    Edit: Here's an approach that doesn't work. Thanks

    Procedure TMyForm.FormClose(Sender: TObject;  Var Action: TCloseAction);
    Begin
      Action := caNone;  //The form is not allowed to close, so nothing happens.
    End;                 // Note: the OP says he tried this, doesn't help. See the comments.
    

提交回复
热议问题