1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use crate::*;
use *;
use Zeroable;
/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowplacement)\]
/// GetWindowPlacement
///
/// Retrieves the show state and the restored, minimized, and maximized positions of the specified window.
///
/// ### Errors
/// * [ERROR::INVALID_WINDOW_HANDLE] If `hwnd` is invalid
///
/// ### Example
/// ```
/// # use hwnd::*;
/// # use winresult::*;
/// # use std::ptr::*;
/// # let hwnd = unsafe { create_window_ex_w(0, abistr::cstr16!("Message"), (), 0, 0, 0, 0, 0, HWnd::MESSAGE, null_mut(), None, null_mut()) }.unwrap();
/// # let p = get_window_placement(get_desktop_window()).unwrap();
/// let p = get_window_placement(hwnd).unwrap();
/// assert_eq!(ERROR::INVALID_WINDOW_HANDLE, get_window_placement(HWnd::NULL));
/// assert_eq!(ERROR::INVALID_WINDOW_HANDLE, get_window_placement(!42usize as HWND));
/// ```
///
/// ### See Also
/// * [WindowPlacement]
/// * [get_window_rect]
/// * [set_window_placement]
/// * [set_window_pos]