User32MonitorFromWindow(SafeHandle, MonitorFromFlags) Method
Retrieves a handle to the display monitor that has the largest area of intersection with the
bounding rectangle of a specified window.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", SetLastError = true)]
public static IntPtr MonitorFromWindow(
SafeHandle hWnd,
MonitorFromFlags flags
)
<DllImportAttribute("User32.dll", SetLastError := true>]
Public Shared Function MonitorFromWindow (
hWnd As SafeHandle,
flags As MonitorFromFlags
) As IntPtr
Dim hWnd As SafeHandle
Dim flags As MonitorFromFlags
Dim returnValue As IntPtr
returnValue = User32.MonitorFromWindow(hWnd,
flags)
public:
[DllImportAttribute(L"User32.dll", SetLastError = true)]
static IntPtr MonitorFromWindow(
SafeHandle^ hWnd,
MonitorFromFlags flags
)
[<DllImportAttribute("User32.dll", SetLastError = true)>]
static member MonitorFromWindow :
hWnd : SafeHandle *
flags : MonitorFromFlags -> IntPtr
No code example is currently available or this language may not be supported.
- hWnd SafeHandle
-
A handle to the window whose parent monitor handle is to be retrieved.
- flags MonitorFromFlags
-
Determines the function's return value if the window does not intersect any display monitor.
IntPtr
If the window intersects one or more display monitor rectangles,
the return value is an
HMONITOR handle to the display monitor that has the
largest area of intersection with the window.
If the window does not intersect a display monitor,
the return value depends on the value of
flags parameters.