Modernflyouts: Pressing the mouse side button will cause the program to crash

Created on 10 Oct 2020  路  2Comments  路  Source: ModernFlyouts-Community/ModernFlyouts

Pressing the mouse side button will cause the program to crash.
But when I play a full screen FPS game and press the side mouse button, it doesn't crash, but the volume bar still appears.
In addition, it is recommended to stop detecting caps when a game is detected.

Bug Enhancement Good First Issue

Most helpful comment

FYI the exception is:

System.OverflowException
  HResult=0x80131516
  Message=Arithmetic operation resulted in an overflow.
  Source=System.Private.CoreLib
  StackTrace:
   at System.IntPtr.op_Explicit(IntPtr value)
   at ModernFlyouts.FlyoutHandler.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) in C:\Users\Simon\Documents\git\ModernFlyouts\ModernFlyouts\FlyoutHandler.cs:line 293
   at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run()
   at ModernFlyouts.Program.Main(String[] args) in C:\Users\Simon\Documents\git\ModernFlyouts\ModernFlyouts\Program.cs:line 27

That's

https://github.com/ShankarBUS/ModernFlyouts/blob/1063dd4f27318ec0b913a5340ee86b19182b1e71/ModernFlyouts/FlyoutHandler.cs#L293-L297

And the value of lParam is 0x0000000080020000.


It's funny that the crash didn't happen on my main PC so I meant to debug #88.

But when I use Remote Desktop to connect to my dev PC and run your code inside Visual Studio, it suddenly crashed.

More interestingly, it still "successfully" popped on my main PC so I was confused for one second.

All 2 comments

Pressing the mouse side button will cause the program to crash.
But when I play a full screen FPS game and press the side mouse button, it doesn't crash.

I don't have a gaming mouse so it may take me some time to find the cause of the crash.

but the volume bar still appears.

The volume bar appearing while pressing those buttons is weird. There's already an issue regarding this. I'll try to find a workaround for this.

In addition, it is recommended to stop detecting caps when a game is detected.

I can feel your inconvenience. I'll do my best.

FYI the exception is:

System.OverflowException
  HResult=0x80131516
  Message=Arithmetic operation resulted in an overflow.
  Source=System.Private.CoreLib
  StackTrace:
   at System.IntPtr.op_Explicit(IntPtr value)
   at ModernFlyouts.FlyoutHandler.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) in C:\Users\Simon\Documents\git\ModernFlyouts\ModernFlyouts\FlyoutHandler.cs:line 293
   at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run()
   at ModernFlyouts.Program.Main(String[] args) in C:\Users\Simon\Documents\git\ModernFlyouts\ModernFlyouts\Program.cs:line 27

That's

https://github.com/ShankarBUS/ModernFlyouts/blob/1063dd4f27318ec0b913a5340ee86b19182b1e71/ModernFlyouts/FlyoutHandler.cs#L293-L297

And the value of lParam is 0x0000000080020000.


It's funny that the crash didn't happen on my main PC so I meant to debug #88.

But when I use Remote Desktop to connect to my dev PC and run your code inside Visual Studio, it suddenly crashed.

More interestingly, it still "successfully" popped on my main PC so I was confused for one second.

Was this page helpful?
0 / 5 - 0 ratings