Add Window::is_minimized
Co-authored-by: Kirill Chibisov <contact@kchibisov.com> Co-authored-by: Markus Siglreithmaier <m.siglreith@gmail.com>
This commit is contained in:
parent
de782504ab
commit
809162fbd0
12 changed files with 83 additions and 11 deletions
|
|
@ -24,9 +24,10 @@ use windows_sys::{
|
|||
Input::KeyboardAndMouse::GetActiveWindow,
|
||||
WindowsAndMessaging::{
|
||||
ClipCursor, GetClientRect, GetClipCursor, GetSystemMetrics, GetWindowRect,
|
||||
ShowCursor, IDC_APPSTARTING, IDC_ARROW, IDC_CROSS, IDC_HAND, IDC_HELP, IDC_IBEAM,
|
||||
IDC_NO, IDC_SIZEALL, IDC_SIZENESW, IDC_SIZENS, IDC_SIZENWSE, IDC_SIZEWE, IDC_WAIT,
|
||||
SM_CXVIRTUALSCREEN, SM_CYVIRTUALSCREEN, SM_XVIRTUALSCREEN, SM_YVIRTUALSCREEN,
|
||||
IsIconic, ShowCursor, IDC_APPSTARTING, IDC_ARROW, IDC_CROSS, IDC_HAND, IDC_HELP,
|
||||
IDC_IBEAM, IDC_NO, IDC_SIZEALL, IDC_SIZENESW, IDC_SIZENS, IDC_SIZENWSE, IDC_SIZEWE,
|
||||
IDC_WAIT, SM_CXVIRTUALSCREEN, SM_CYVIRTUALSCREEN, SM_XVIRTUALSCREEN,
|
||||
SM_YVIRTUALSCREEN,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -135,6 +136,10 @@ pub fn is_focused(window: HWND) -> bool {
|
|||
window == unsafe { GetActiveWindow() }
|
||||
}
|
||||
|
||||
pub fn is_minimized(window: HWND) -> bool {
|
||||
unsafe { IsIconic(window) != false.into() }
|
||||
}
|
||||
|
||||
pub fn get_instance_handle() -> HINSTANCE {
|
||||
// Gets the instance handle by taking the address of the
|
||||
// pseudo-variable created by the microsoft linker:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue