Skip to content

Commit

Permalink
doc: [learn.microsoft.com][microsoft.com]
Browse files Browse the repository at this point in the history
  • Loading branch information
MaulingMonkey committed Jan 21, 2024
1 parent aa867d8 commit 65060cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions src/values/hwnd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use core::ptr::NonNull;



/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/learnwin32/what-is-a-window-)\]
/// \[[microsoft.com](https://learn.microsoft.com/en-us/windows/win32/learnwin32/what-is-a-window-)\]
/// `HWND`
/// —
/// A weak handle to a "window" on this computer.
Expand Down Expand Up @@ -46,7 +46,7 @@ impl From<Option<NonNullHWND>> for HWND { fn from(hwnd: Option<NonNullHWND>) ->
#[allow(dead_code)] impl HWND {
#[inline(always)] const fn from_constant(hwnd: isize) -> Self { Self(hwnd as _) }

/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/winmsg/window-features#message-only-windows)\]
/// \[[microsoft.com](https://learn.microsoft.com/en-us/windows/win32/winmsg/window-features#message-only-windows)\]
/// `HWND_MESSAGE = -3`
///
/// Can be passed to [`CreateWindowW`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-createwindoww) etc. as `hWndParent` to create a message-only window, which:
Expand All @@ -56,21 +56,21 @@ impl From<Option<NonNullHWND>> for HWND { fn from(hwnd: Option<NonNullHWND>) ->
/// * Does not receive broadcast messages
pub const MESSAGE : Self = Self::from_constant(-3);

/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos#parameters)\]
/// \[[microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos#parameters)\]
/// `HWND_NOTOPMOST = -2`
///
/// Can be passed to [`SetWindowPos`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos) etc. as
/// `hWndInsertAfter` to (conditionally) place the window above all non-topmost windows (without *becoming* a topmost window.)
pub const NOTOPMOST : Self = Self::from_constant(-2);

/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos#parameters)\]
/// \[[microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos#parameters)\]
/// `HWND_TOPMOST = -1`
///
/// Can be passed to [`SetWindowPos`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos) etc. as
/// `hWndInsertAfter` to (conditionally) place the window above all non-topmost windows (*becoming* a topmost window.)
pub const TOPMOST : Self = Self::from_constant(-1);

/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos#parameters)\]
/// \[[microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos#parameters)\]
/// `HWND_TOP = 0`
///
/// Can be passed to [`SetWindowPos`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos) etc. as
Expand All @@ -83,7 +83,7 @@ impl From<Option<NonNullHWND>> for HWND { fn from(hwnd: Option<NonNullHWND>) ->
/// * [`SetWindowPos`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos) will interpret `0` as "place the window at the top of the Z order"
pub const TOP : Self = Self::from_constant(0);

/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-mapwindowpoints#parameters)\]
/// \[[microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-mapwindowpoints#parameters)\]
/// `HWND_DESKTOP = 0`
///
/// Can be passed to [`MapWindowPoints`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-mapwindowpoints#parameters) as
Expand All @@ -96,7 +96,7 @@ impl From<Option<NonNullHWND>> for HWND { fn from(hwnd: Option<NonNullHWND>) ->
/// * [`SetWindowPos`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos) will interpret `0` as "place the window at the top of the Z order"
pub const DESKTOP : Self = Self::from_constant(0);

/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/learnwin32/what-is-a-window-)\]
/// \[[microsoft.com](https://learn.microsoft.com/en-us/windows/win32/learnwin32/what-is-a-window-)\]
/// `0` / `nullptr`
///
/// **N.B.:** `0` / `nullptr` / `HWND_TOP` / `HWND_DESKTOP` can have wildly different meanings depending on which API it is passed to:
Expand All @@ -106,14 +106,14 @@ impl From<Option<NonNullHWND>> for HWND { fn from(hwnd: Option<NonNullHWND>) ->
/// * [`SetWindowPos`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos) will interpret `0` as "place the window at the top of the Z order"
pub const NULL : Self = Self::from_constant(0);

/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos#parameters)\]
/// \[[microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos#parameters)\]
/// `HWND_BOTTOM = 1`
///
/// Can be passed to [`SetWindowPos`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos) etc. as
/// `hWndInsertAfter` to (conditionally) place the window below all other windows (losing *topmost* status if it had it.)
pub const BOTTOM : Self = Self::from_constant(1);

/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendmessage#parameters)\]
/// \[[microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendmessage#parameters)\]
/// `HWND_BROADCAST = 0xFFFF`
///
/// Can be passed to [`SendMessage`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendmessage#parameters) etc. as
Expand All @@ -139,7 +139,7 @@ impl From<Option<NonNullHWND>> for HWND { fn from(hwnd: Option<NonNullHWND>) ->
#[inline(always)] pub(crate) fn to_nz_usize (self) -> Option<NonZeroUsize> { NonZeroUsize::new(self.0 as _) }
}

/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowlongptrw)\]
/// \[[microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowlongptrw)\]
/// GetWindowsLongPtrW
pub(crate) fn get_window_long_ptr_w(hwnd: impl Into<HWND>, index: impl Into<c_int>) -> isize {
#[link(name = "user32")] extern "system" {
Expand Down
6 changes: 3 additions & 3 deletions src/values/non_null_hwnd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use core::ptr::NonNull;



/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/learnwin32/what-is-a-window-)\]
/// \[[microsoft.com](https://learn.microsoft.com/en-us/windows/win32/learnwin32/what-is-a-window-)\]
/// `__attribute__((nonnull)) HWND`
/// &mdash;
/// A weak handle to a "window" on this computer.
Expand Down Expand Up @@ -44,7 +44,7 @@ impl From<HWND> for Option<NonNullHWND> { fn from(hwnd: HWND) -> Self { NonN
#[allow(dead_code)] impl NonNullHWND {
#[inline(always)] const fn from_constant(hwnd: isize) -> Self { match NonZeroUsize::new(hwnd as _) { Some(v) => Self(v), None => panic!("invalid constant") } }

/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/winmsg/window-features#message-only-windows)\]
/// \[[microsoft.com](https://learn.microsoft.com/en-us/windows/win32/winmsg/window-features#message-only-windows)\]
/// `HWND_MESSAGE = -3`
///
/// Can be passed to [`CreateWindowW`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-createwindoww) etc. as `hWndParent` to create a message-only window, which:
Expand All @@ -61,7 +61,7 @@ impl From<HWND> for Option<NonNullHWND> { fn from(hwnd: HWND) -> Self { NonN
//pub const NULL : Self = Self::from_constant(0); // nullptr - cannot be a NonNullHWND.
//pub const BOTTOM : Self = Self::from_constant(1); // SetWindowPos param - not all values can be NonNullHWND, so expose none of them as NonNullHWND.

/// \[[learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendmessage#parameters)\]
/// \[[microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendmessage#parameters)\]
/// `HWND_BROADCAST = 0xFFFF`
///
/// Can be passed to [`SendMessage`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendmessage#parameters) etc. as
Expand Down

0 comments on commit 65060cf

Please sign in to comment.