Preventing Windows shut down

前端 未结 7 569
梦毁少年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.
    
    0 讨论(0)
提交回复
热议问题