getting process icon using the process HANDLE

Viewed 36

I need to get exe icons into bitmaps for display with only the process pid. im using the windows-rs crate to interact with windows api. so far i can get the handle of the process and the name and the path.

pretty sure i need to do something like this for the icons

let mut icons_Large = Box::into_raw(Box::new(HICON::default()));
let mut small_Large = Box::into_raw(Box::new(HICON::default()));

let extract = ExtractIconExW(PCWSTR::from(None), 0, icons_Large, small_Large, 1);
let icon_handle = LoadImageW(hinst, name, r#type, cx, cy, fuload)

haven't managed to figure out how to get PCWSTR from the process HANDLE or the HINSTANCE

0 Answers
Related