Name

FindWindowEx

Synopsis

Searches for a specified child window:

Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
		(ByVal hWnd1 As Long, ByVal hWnd2 As Long, _
		ByVal lpsz1 As String, ByVal lpsz2 As String) As Long

Parameters

hWnd1

The hWnd of the parent window to the window that you want to find. The function uses this parameter as a starting point for searching for the target window. If Null, the function uses the desktop as the parent window.

hWnd2

The hWnd of any child windows to the window specified by the hWnd1 parameter. If a valid child window handle is provided, this function starts searching through all the windows that are children to the window specified by this parameter.

lpsz1

The class name or class atom of the window that we are searching for.

lpsz2

The caption of the window that we are searching for.

Return Value

If this function succeeds, the hWnd of the window is returned; otherwise, it returns a 0, indicating failure.

Get Subclassing and Hooking with Visual Basic now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.