tasklist 0.1.1

Get the process name or process id on windows
docs.rs failed to build tasklist-0.1.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: tasklist-0.2.12

tasklist-rs

a crate let you can easily get process name or process id on windows

use tasklist;

fn main(){
    unsafe{
        //get a HashMap<String,u32> of the tasklist
        let list = tasklist::tasklist();
        println!("{:#?}",list);

        //find the process name by id
        let pname = tasklist::find_process_name_by_id(9720);
        println!("{:#?}",pname);

        //find first process id by name
        let pid = tasklist::find_first_process_id_by_name("cmd.exe");
        println!("{:#?}",pid);

        //find process id by name
        let aid = tasklist::find_process_id_by_name("cmd.exe");
        println!("{:#?}",aid);
    }
    

}

Usage

Add this to your Cargo.toml:

[dependencies]
tasklist = "0.1.1"