Crate windows_async

Source
Expand description

Simple async executor for windows application using windows crate.

§Examples

// 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);
    }
}

Structs§

DummyWindow
Wrapper type of invisible window handle.

Functions§

block_on
Run a future to completion on the current thread.
create_dummy_window
Create invisible dummy window.