How to create simple UWP application using windows-rs crate from rust?

Timothy M. Heath 20 Reputation points
2024-04-04T15:44:47.1+00:00

Trying to use a capture object picker which requires to have a main processor loop which is only run in a window so the uwp unlike win32 requires a window to be created from. How am I supposed to instantiate that window using windows-rs/the windows runtime?

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. WithinRafael 326 Reputation points
    2024-04-04T18:17:01.29+00:00

    The Rust for Windows crate does not currently support XAML, etc. That was yanked out for various reasons. But to get to the core of your issue, it sounds like you want to use Windows.Graphics.Capture APIs and are battling some dependencies.

    I suggest taking a look at Rob's screenshot-rs crate; it demonstrates correct usage of Windows.Graphics.* APIs (https://github.com/robmikh/screenshot-rs) with Rust.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful