hwnd 0.0.0-2024-01-05

Well documented, safe-leaning, sound, low-level API bindings to `HWND`-adjacent APIs
Documentation
//! \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowlongw)\]
//! GWL_\* indicies for [get_window_long_w]

#![allow(non_snake_case)]
#![allow(deprecated)]

use crate::*;
use bytemuck::*;
use winapi::um::winuser::*;



/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowlongw)\]
/// GWL_\* index for [get_window_long_w]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default, Zeroable)] #[repr(transparent)] pub struct GetWindowLongIndex(i32);

impl From<GetWindowLongIndex> for i32 { fn from(cmd: GetWindowLongIndex) -> Self { cmd.0 } }
impl From<i32> for GetWindowLongIndex { fn from(cmd: i32 ) -> Self { Self(cmd) } }

impl PartialEq<i32> for GetWindowLongIndex { fn eq(&self, other: &i32 ) -> bool { self.0 == *other } }
impl PartialEq<GetWindowLongIndex> for i32 { fn eq(&self, other: &GetWindowLongIndex) -> bool { *self == other.0 } }

impl_debug_for_enum! {
    GetWindowLongIndex => {
        GWL::STYLE,
        GWL::EXSTYLE,
        GWL::ID,
        GWL::WNDPROC,
        GWL::HINSTANCE,
        GWL::HWNDPARENT,
        GWL::USERDATA,
    }
}



pub const STYLE         : GetWindowLongIndex = GetWindowLongIndex(GWL_STYLE);
pub const EXSTYLE       : GetWindowLongIndex = GetWindowLongIndex(GWL_EXSTYLE);
pub const ID            : GetWindowLongIndex = GetWindowLongIndex(GWL_ID);

#[cfg(not(target_pointer_width = "64"))] pub        use win64::*;
#[cfg(    target_pointer_width = "64" )] pub(crate) use win64::*;

mod win64 {
    use super::*;
    #[deprecated = "prefer GWLP::WNDPROC"      ] pub const WNDPROC       : GetWindowLongIndex = GetWindowLongIndex(GWL_WNDPROC);
    #[deprecated = "prefer GWLP::HINSTANCE"    ] pub const HINSTANCE     : GetWindowLongIndex = GetWindowLongIndex(GWL_HINSTANCE);
    #[deprecated = "prefer GWLP::HWNDPARENT"   ] pub const HWNDPARENT    : GetWindowLongIndex = GetWindowLongIndex(GWL_HWNDPARENT);
    #[deprecated = "prefer GWLP::USERDATA"     ] pub const USERDATA      : GetWindowLongIndex = GetWindowLongIndex(GWL_USERDATA);
}