pub unsafe fn is_menuitem_enabled(h: HMENU, pos: Option<UINT>, id: Option<UINT>) -> bool {
    use winapi::um::winuser::{MENUITEMINFOW, MIIM_STATE, MFS_DISABLED};
    use winapi::um::winuser::GetMenuItemInfoW;
    use winapi::shared::minwindef::BOOL;

    if id.is_none() && pos.is_none() { panic!("Both pos and id are None"); }

    let use_position = id.is_none();
    let choice = if use_position { pos } else { id };
    let value = match choice {
        Some(p) => p,
        None => unreachable!()
    };

    let mut info = MENUITEMINFOW { 
        cbSize: mem::size_of::<MENUITEMINFOW>() as UINT,
        fMask: MIIM_STATE, fType: 0, fState: 0,
        wID: 0, hSubMenu: ptr::null_mut(), hbmpChecked: ptr::null_mut(),
        hbmpUnchecked: ptr::null_mut(), dwItemData: 0, dwTypeData: ptr::null_mut(),
        cch: 0, hbmpItem: ptr::null_mut()
    };

    GetMenuItemInfoW(h, value, use_position as BOOL, &mut info);

    (info.fState & MFS_DISABLED) != MFS_DISABLED
}
/**
    Return the state of a menuitem. Panic if both pos and id are None.
*/
Return the state of a menuitem. Panic if both pos and id are None.
Return the state of a menuitem . Panic if both pos and id are None .
pub unsafe fn is_menuitem_enabled(h: HMENU, pos: Option<UINT>, id: Option<UINT>) -> bool {
    use winapi::um::winuser::{MENUITEMINFOW, MIIM_STATE, MFS_DISABLED};
    use winapi::um::winuser::GetMenuItemInfoW;
    use winapi::shared::minwindef::BOOL;
    if id.is_none() && pos.is_none() { panic!("Both pos and id are None"); }
    let use_position = id.is_none();
    let choice = if use_position { pos } else { id };
    let value = match choice {
        Some(p) => p,
        None => unreachable!()
    };
    let mut info = MENUITEMINFOW { 
        cbSize: mem::size_of::<MENUITEMINFOW>() as UINT,
        fMask: MIIM_STATE, fType: 0, fState: 0,
        wID: 0, hSubMenu: ptr::null_mut(), hbmpChecked: ptr::null_mut(),
        hbmpUnchecked: ptr::null_mut(), dwItemData: 0, dwTypeData: ptr::null_mut(),
        cch: 0, hbmpItem: ptr::null_mut()
    };
    GetMenuItemInfoW(h, value, use_position as BOOL, &mut info);
    (info.fState & MFS_DISABLED) != MFS_DISABLED
}
pub unsafe fn is_menuitem_enabled ( h : HMENU , pos : Option < UINT > , id : Option < UINT > ) -> bool { use winapi :: um :: winuser :: { MENUITEMINFOW , MIIM_STATE , MFS_DISABLED } ; use winapi :: um :: winuser :: GetMenuItemInfoW ; use winapi :: shared :: minwindef :: BOOL ; if id . is_none ( ) && pos . is_none ( ) { panic ! ( " " ) ; } let use_position = id . is_none ( ) ; let choice = if use_position { pos } else { id } ; let value = match choice { Some ( p ) => p , None => unreachable ! ( ) } ; let mut info = MENUITEMINFOW { cbSize : mem :: size_of :: < MENUITEMINFOW > ( ) as UINT , fMask : MIIM_STATE , fType : 0 , fState : 0 , wID : 0 , hSubMenu : ptr :: null_mut ( ) , hbmpChecked : ptr :: null_mut ( ) , hbmpUnchecked : ptr :: null_mut ( ) , dwItemData : 0 , dwTypeData : ptr :: null_mut ( ) , cch : 0 , hbmpItem : ptr :: null_mut ( ) } ; GetMenuItemInfoW ( h , value , use_position as BOOL , & mut info ) ; ( info . fState & MFS_DISABLED ) != MFS_DISABLED }
Return the state of a menuitem.
Return the state of a menuitem .
h
HMENU
pos
Option<UINT>
id
Option<UINT>