User32FindWindow Method

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

This function does not search child windows. This function does not perform a case-sensitive search.

To search child windows, beginning with a specified child window, use the FindWindowEx(IntPtr, IntPtr, String, String) function.

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 FindWindow(
	string className,
	string windowName
)

Parameters

className  String
The class name or a class atom created by a previous call to the RegisterClass or RegisterClassEx function.

The atom must be in the low-order word of className; the high-order word must be zero.

If className is NULL, it finds any window whose title matches the windowName parameter.

windowName  String
The window name (the window's titlebar title).

If this parameter is , all window names match.

Return Value

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

If the function fails, the return value is .

Remarks

See Also