FindWindow

  HWND FindWindow(lpszClass, lpszWindow)    
  LPCTSTR lpszClass; /* address of class-name string */
  LPCTSTR lpszWindow; /* address of window-name string */

The FindWindow function retrieves the handle of the window whose class name and window name match the specified strings. This function does not search child windows.

Parameters

lpszClass

Points to a null-terminated string or is an atom that identifies a string. If this parameter is an atom, it must be a global atom created by a previous call to the GlobalAddAtom function. The atom, a 16-bit value, must be placed in the low-order word of lpszClass; the high-order word must be zero.

The lpszClass string or atom specifies the window class name.

lpszWindow

Points to a null-terminated string that specifies the window name (the window's title). If this parameter is NULL, all window names match.

Return Value

The return value is the handle of the window that has the specified class name and window name if the function is successful. Otherwise, it is NULL.

Comments

The FindWindow function may be used as either a wide-character function (where text arguments must use Unicode) or an ANSI function (where text arguments must use characters from the Windows 3.x character set installed).

See Also

EnumWindows, GetClassName