mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-16 03:47:06 +12:00
Use ToInt64
This commit is contained in:
parent
9d94f1f203
commit
e7e30a46c2
|
@ -302,9 +302,9 @@ protected override void WndProc(ref Message m)
|
||||||
{
|
{
|
||||||
if (m.Msg == (int)WindowsMessages.QUERYENDSESSION)
|
if (m.Msg == (int)WindowsMessages.QUERYENDSESSION)
|
||||||
{
|
{
|
||||||
// Casting to long before because the int conversion operator enforces checked semantics
|
// Calling ToInt64 because the int conversion operator (called when irectly casting the IntPtr to the enum)
|
||||||
// thus crashes any 64 bits build. IntPtr -> long and long -> enum doesn't.
|
// enforces checked semantics thus crashes any 64 bits build. ToInt64() and long -> enum conversion doesn't.
|
||||||
EndSessionReasons reason = (EndSessionReasons)(long)(m.LParam);
|
EndSessionReasons reason = (EndSessionReasons)m.LParam.ToInt64();
|
||||||
if (reason.HasFlag(EndSessionReasons.ENDSESSION_CLOSEAPP))
|
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.
|
// 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