Welcome to our Microsoft Q&A platform!
I think you can use System.Windows.Threading.Timer to handle your tick.
see the following link:
why-does-the-dispatcher-timer-in-wpf-lag-when-i-hover-over-my-application-window
Thanks.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I am building a game in wpf for a school project and I have noticed that the UI thread clogs up when I move the mouse over any window within the application (DispatcherTimer ticks are less frequent, which casues my game to lag and tear).
Is there a way to disable internal mouse handling, so I can have my own? Cursor is hidden by default so I do not really understand what is handled related to mouse movement in the background which could have such significant effect. Can you also shed some light on that as well. Thank you in advance!
Welcome to our Microsoft Q&A platform!
I think you can use System.Windows.Threading.Timer to handle your tick.
see the following link:
why-does-the-dispatcher-timer-in-wpf-lag-when-i-hover-over-my-application-window
Thanks.
Hi,
you can try mouse handling with win32 apis, take a look to this document https://www.pinvoke.net/default.aspx/user32.mouse_event
Best regards,
Mouad.