Preventing Windows shut down

前端 未结 7 567
梦毁少年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:50

    Are you testing on the same OS? There are some application shutdown changes in Vista. Read this: Application Shutdown Changes in Windows Vista

    If you are testing on the same OS, maybe Delphi 2010 handles WM_ENDSESSION messages in a different way. In Delphi 7, WM_ENDSESSION message are handled in Application.WndProc.

提交回复
热议问题