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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
use crate::*;
use *;
/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getactivewindow)\]
/// GetActiveWindow
///
/// Retrieves the window handle to the active window attached to the calling thread's message queue.
///
/// ### Returns
/// * The active window attached to the calling thread's message queue.
/// * Otherwise, NULL.
///
/// ### Example
/// ```rust
/// # use hwnd::*;
/// let active : HWnd = get_active_window();
/// assert!(active.is_null(), "unit tests don't have an active window");
/// ```
/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdesktopwindow)\]
/// GetDesktopWindow
///
/// Retrieves a handle to the desktop window.
/// The desktop window covers the entire screen.
/// The desktop window is the area on top of which other windows are painted.
///
/// ### Example
/// ```rust
/// # use hwnd::*;
/// let desktop : HWnd = get_desktop_window();
/// assert!(!desktop.is_null(), "the desktop should never be null");
/// ```
/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdesktopwindow)\]
/// GetForegroundWindow
///
/// Retrieves a handle to the foreground window (the window with which the user is currently working).
/// The system assigns a slightly higher priority to the thread that creates the foreground window than it does to other threads.
///
/// The foreground window can be NULL in certain circumstances, such as when a window is losing activation.
///
/// ### Example
/// ```rust
/// # use hwnd::*;
/// let foreground : HWnd = get_foreground_window();
/// dbg!(foreground.is_null()); // may or may not be null
/// ```
/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getshellwindow)\]
/// GetShellWindow
///
/// Retrieves a handle to the Shell's desktop window.
///
/// ### Returns
/// * The handle of the Shell's desktop window.
/// * If no Shell process is present, NULL.
///
/// ### Example
/// ```rust
/// # use hwnd::*;
/// let shell : HWnd = get_shell_window();
/// assert_ne!(get_desktop_window(), shell, "These *are* different handles, but I'm not entirely sure how.");
/// ```