Please provide working code (if this is at all possible with windows). ShutdownBlockReasonCreate(Me.Handle, "Testing 123.") If aMessage.Msg = WM_QUERYENDSESSION OrElse aMessage.Msg = WM_ENDSESSION Then Protected Overrides Sub WndProc(ByRef aMessage As Message)Ĭonst WM_QUERYENDSESSION As Integer = &H11 How can I achieve a delay without windows aborting the shutdown after a minute? (perhaps it takes 2 or 4 minutes for my app to finish up) Public Class Form1ĭeclare Function ShutdownBlockReasonCreate Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal reason As String) As Booleanĭeclare Function ShutdownBlockReasonDestroy Lib "user32.dll" (ByVal hWnd As IntPtr) As Boolean I want to delay windows 10 from shutting down so that my app can finish up some necessary actions like saving data.įollowing is a working code example to achieve a delay, however windows cancels the shutdown after about 1 minute of waiting.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |