3 out of 10 rated this helpful - Rate this topic

GetNextWindow function

Applies to: desktop apps only

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

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

See also

Reference
GetTopWindow
GetWindow
Conceptual
Windows

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ