I want to set DWMWA_TRANSITIONS_FORCEDISABLED, but not clear how to pass the arguments. Could anyone give an example how to use winapi_ui_automation::um::dwmapi::DwmSetWindowAttribute ?
Though I added dependency in Cargo.toml winapi-ui-automation = "0.3.10", and in main.rs extern crate winapi_ui_automation;, when built an error say "can't find crate winapi_ui_automation". I find the crate, how could I added to my project ?
Could you please give a short explainaton of this conversion? &value as *const BOOL as *const _,. I have bool value, and need a pointer LPCVOID. Why two step conversion , and a ' _ ' ?
You can cast from a &TypeOne to a *const TypeOne, and from a *const TypeOne to a *const TypeTwo, but you can't cast directly from &TypeOne to *const TypeTwo.
In general, _ means "compiler, please infer the type for me". It's possible here because the compiler knows what the types of the arguments to DwmSetWindowAttribute are (and because LPCVOID is a type alias for *const c_void).
So,
&value // &BOOL
as *const BOOL // *const BOOL
as *const _ // *const c_void, aka LPCVOID