User32CalculatePopupWindowPosition Method

Calculates an appropriate pop-up window position using the specified anchor point, pop-up window size, flags, and the optional exclude rectangle.

When the specified pop-up window size is smaller than the desktop window size, use the CalculatePopupWindowPosition(NativePoint, NativeSize, PopupWindowPositionFlags, NativeRectangle, NativeSize) function to ensure that the pop-up window is fully visible on the desktop window, regardless of the specified anchor point.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: 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 bool CalculatePopupWindowPosition(
	ref NativePoint refAnchorPoint,
	ref NativeSize refWindowSize,
	PopupWindowPositionFlags flags,
	ref NativeRectangle refExcludeRect,
	ref NativeSize refPopupPosition
)

Parameters

refAnchorPoint  NativePoint
A pointer to a NativePoint structure that specifies the specified anchor point.
refWindowSize  NativeSize
A pointer to a NativeSize structure that specifies the specified window size.
flags  PopupWindowPositionFlags
Flags that specifies how the function positions the pop-up window horizontally and vertically.
refExcludeRect  NativeRectangle
A pointer to a NativeRectangle structure that specifies the exclude rectangle.

It can be .

refPopupPosition  NativeSize
A pointer to a NativeSize structure that specifies the pop-up window position.

Return Value

Boolean
If the function succeeds, the return value is ; If the function fails, the return value is .

To get extended error information, call GetLastWin32Error.

Remarks

See Also