0

In my UWP project I am using CoreDispatcher.ProcessEvents function like mentioned in https://github.com/microsoft/Windows-universal-samples/blob/main/Samples/LowLatencyInput/

I want to convert it for WinUI3. But I got stuck to mimic behavior of coreInput->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);

Code that is used in my UWP project is provided below:

 while (CanRun)
 {
     inputSource->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);
     if (!CanRun) break;
     DoSomeOperation();
 }

But inputSource->Dispatcher->ProcessEvents is not available for WinUI3.

How to mimic same behavior in C++/WinRT for WinUI3 Project.

3
  • You can create a thread and instantiate a Window in there and/or use Windows API (like raw input ones) with WinUI3/WinAppSDK, so I guess that's why they have not ported these into. Commented Apr 30 at 15:30
  • Yes I understand that, but how to mimic operation like CoreProcessEventsOption::ProcessOneAndAllPending Commented Apr 30 at 16:21
  • This is probably equivalent to the window's message loop (in another thread). Commented Apr 30 at 18:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.