windows-async

Crates.iowindows-async
lib.rswindows-async
version0.2.1
sourcesrc
created_at2022-03-11 11:08:57.787279
updated_at2022-03-11 19:19:09.224206
descriptionSimple async executor for windows application using windows crate.
homepage
repositoryhttps://github.com/saelay/windows-async-rs
max_upload_size
id548172
size19,565
(saelay)

documentation

README

windows-async-rs

Simple async executor for windows application using windows crate.

Example

// 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);
    }
}
Commit count: 13

cargo fmt