Share via

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?

Developer technologies | Universal Windows Platform (UWP)
0 comments No comments

Answer accepted by question author

WithinRafael 326 Reputation points Volunteer Moderator
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.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.