Perhaps GetWindow, with the command being GW_HWNDFIRST
Code:
Const GW_HWNDFIRST = 0
Public Declare Function GetWindow _
Lib "user32" _
Alias "GetWindow" (ByVal hwnd As Long, _
ByVal wCmd As Long) As Long
Help says, of this const:
The retrieved handle identifies the window of the same type that is highest in the Z order. If the specified window is a topmost window, the handle identifies the topmost window that is highest in the Z order. If the specified window is a top-level window, the handle identifies the top-level window that is highest in the Z order. If the specified window is a child window, the handle identifies the sibling window that is highest in the Z order.