Crates.io | windows-async |
lib.rs | windows-async |
version | 0.2.1 |
source | src |
created_at | 2022-03-11 11:08:57.787279 |
updated_at | 2022-03-11 19:19:09.224206 |
description | Simple async executor for windows application using windows crate. |
homepage | |
repository | https://github.com/saelay/windows-async-rs |
max_upload_size | |
id | 548172 |
size | 19,565 |
Simple async executor for windows application using windows crate.
// Show Desktop App list example (using WinRT "Windows.Inventory.InstalledDesktopApp")
use windows::core::{
Result,
};
use windows::System::Inventory::{
InstalledDesktopApp,
};
async fn show_installed_desktop_app() -> Result<()> {
let vec = InstalledDesktopApp::GetInventoryAsync()?.await?;
for i in 0..vec.Size()? {
let item = vec.GetAt(i)?;
println!("Id: {:?}", item.Id()?);
println!("DisplayName: {:?}", item.DisplayName()?);
println!("Publisher: {:?}", item.Publisher()?);
println!("DisplayVersion: {:?}", item.DisplayVersion()?);
println!();
}
Ok(())
}
fn main() {
if let Err(e) = windows_async::block_on(show_installed_desktop_app()) {
println!("error: {:?}", e);
}
}