mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
commit
fd0719bcd6
1 changed files with 3 additions and 1 deletions
|
@ -302,7 +302,9 @@ protected override void WndProc(ref Message m)
|
|||
{
|
||||
if (m.Msg == (int)WindowsMessages.QUERYENDSESSION)
|
||||
{
|
||||
EndSessionReasons reason = (EndSessionReasons)(m.LParam.ToInt64() & 0xFFFFFFFF);
|
||||
// Calling ToInt64 because the int conversion operator (called when directly casting the IntPtr to the enum)
|
||||
// enforces checked semantics thus crashes any 64 bits build. ToInt64() and long -> enum conversion doesn't.
|
||||
EndSessionReasons reason = (EndSessionReasons)m.LParam.ToInt64();
|
||||
if (reason.HasFlag(EndSessionReasons.ENDSESSION_CLOSEAPP))
|
||||
{
|
||||
// Register for restart. This allows our application to automatically restart when it is installing an update from the Store.
|
||||
|
|
Loading…
Reference in a new issue