ComCtl32ListBoxItemFromPoint(IntPtr, Point, Boolean) Method

Retrieves the index of the item at the specified point in a list box.

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("ComCtl32.dll", EntryPoint = "LBItemFromPt", SetLastError = true)]
public static int ListBoxItemFromPoint(
	IntPtr hWnd,
	Point pt,
	bool autoScroll
)

Parameters

hWnd  IntPtr
A handle to the list box to check.
pt  Point
A Point structure that contains the screen coordinates to check.
autoScroll  Boolean
If this parameter is and the point is directly above or below the list box, the function scrolls the list box by one line and returns -1. Otherwise, the function does not scroll the list box.

Return Value

Int32
Returns the item identifier if the point is over a list item, or -1 otherwise.

Remarks

See Also