hwnd 0.0.0-2024-01-05

Well documented, safe-leaning, sound, low-level API bindings to `HWND`-adjacent APIs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//use winapi::shared::winerror::*;
use winapi::um::errhandlingapi::SetLastError;

pub(crate) fn clear_last_error() { set_last_error(0) }
pub(crate) fn set_last_error(code: u32) { unsafe { SetLastError(code) } }

// XXX: To avoid tripping up other code, this should probably be a scoped thing that also clears the error code
//pub(crate) fn debug_set_last_error_invalid() {
//    if cfg!(debug_assertions) {
//        //set_last_error(ERROR_INTERNAL_ERROR);
//        set_last_error(ERROR_INVALID_FUNCTION);
//    }
//}