Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WinAPI function SetCursorPos issues. Win 10 version 1803

$
0
0

Hi, my name is Sergey and i have a question. I have Window 10

I have a code like this:

WinAPI.SetCursorPos((Int32)(start.X), (Int32)(start.Y + 1));
Wait();
WinAPI.SetCursorPos((Int32)(end.X), (Int32)(end.Y));
Wait();

start and end are points above wpf control.

Wait method look like this:

public static void Wait() {    DispatcherPriority priority = DispatcherPriority.ContextIdle;

EnumerateWindows().ToList().ForEach(wnd => wnd.Dispatcher.Invoke(() => { }, priority)); }

and used to pump message queue which causes to handle mouse move event of control for each SetCursorPos call.

Since windows 10 update 1803 SetCursorPos does not fire mouse move event and it handler does not call. For Windows 10 version 1703 works properly.

Does exist some fixes of this problem?  



Viewing all articles
Browse latest Browse all 18858

Trending Articles