Expand Minimize

GetNextWindow function

Retrieves a handle to the next or previous window in the Z-Order. The next window is below the specified window; the previous window is above.

If the specified window is a topmost window, the function searches for a topmost window. If the specified window is a top-level window, the function searches for a top-level window. If the specified window is a child window, the function searches for a child window.

Syntax


HWND WINAPI GetNextWindow(
  _In_  HWND hWnd,
  _In_  UINT wCmd
);

Parameters

hWnd [in]

Type: HWND

A handle to a window. The window handle retrieved is relative to this window, based on the value of the wCmd parameter.

wCmd [in]

Type: UINT

Indicates whether the function returns a handle to the next window or the previous window. This parameter can be either of the following values.

ValueMeaning
GW_HWNDNEXT
2

Returns a handle to the window below the given window.

GW_HWNDPREV
3

Returns a handle to the window above the given window.

 

Return value

Type:

Type: HWND

If the function succeeds, the return value is a handle to the next (or previous) window. If there is no next (or previous) window, the return value is NULL. To get extended error information, call GetLastError.

Remarks

This function is implemented as a call to the GetWindow function.

#define GetNextWindow(hWnd, wCmd) GetWindow(hWnd, wCmd)

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

See also

Reference
GetTopWindow
GetWindow
Conceptual
Windows

 

 

Community Additions

ADD
Show:
© 2014 Microsoft