Please, can someone post an example how to show the progress in a taskbar button on Windows?
I've seen that the winapi crate seems to have support for this:
winapi::um::shobjidl_core::ITaskbarList
winapi::um::shobjidl_core::ITaskbarList4
But I have no idea how to use it.
With WinSafe crate things are a lot cleaner (and easier):
use winsafe::{self as w, co, shell};
let hwnd: HWND; // handle to your window, initialized somewhere
// Create the COM object.
let itbl: shell::ITaskbarList4 = w::CoCreateInstance(
&shell::clsid::TaskbarList,
None,
co::CLSCTX::INPROC_SERVER,
).unwrap();
// Set the progress to 50%.
itbl.SetProgressValue(hwnd, 50, 100)
.unwrap();
// Set the color to yellow.
itbl.SetProgressState(hwnd, shell::co::TBPF::PAUSED)
.unwrap();