User32FindWindowEx(SafeHandle, SafeHandle, String, String) Method

Retrieves a handle to a window whose class name and window name match the specified strings.

The function searches child windows, beginning with the one following the specified child window.

This function does not perform a case-sensitive search.

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", CharSet = CharSet.Auto, BestFitMapping = false, 
	ThrowOnUnmappableChar = true, SetLastError = true)]
public static IntPtr FindWindowEx(
	SafeHandle hWndParent,
	SafeHandle hWndChildAfter,
	string className,
	string windowName
)

Parameters

hWndParent  SafeHandle
A IntPtr handle to the parent window whose child windows are to be searched.

If hwndParent is Zero, the function uses the desktop window as the parent window.

The function searches among windows that are child windows of the desktop.

hWndChildAfter  SafeHandle
A IntPtr handle to a child window.

The search begins with the next child window in the Z order.

The child window must be a direct child window of hwndParent, not just a descendant window.

If hwndChildAfter is Zero, the search begins with the first child window of hwndParent.

className  String
The window class name.
windowName  String
The window name (the window title).

If this parameter is , all window names match.

Return Value

IntPtr
If the function succeeds, the return value is a IntPtr handle to the window that has the specified class and window names.

If the function fails, the return value is Zero.

Remarks

See Also