Activates the next window in a window group that was defined with GroupAdd.

HWND := GroupActivate(GroupName , Mode)



Type: String

The name of the group to activate, as originally defined by GroupAdd.


Type: String

If omitted, the function activates the oldest window in the series. To change this behavior, specify the following letter:

R: The newest window (the one most recently active) is activated, but only if no members of the group are active when the function is given. "R" is useful in cases where you temporarily switch to working on an unrelated task. When you return to the group via GroupActivate, GroupDeactivate, or GroupClose, the window you were most recently working with is activated rather than the oldest window.

Return Value

Type: Integer

This function returns the HWND (unique ID) of the window selected for activation, or 0 if no matching windows were found to activate. If the current active window is the only match, the return value is 0.


This function causes the first window that matches any of the group's window specifications to be activated. Using it a second time will activate the next window in the series and so on. Normally, it is assigned to a hotkey so that this window-traversal behavior is automated by pressing that key.

When a window is activated immediately after another window was activated, task bar buttons may start flashing on some systems (depending on OS and settings). To prevent this, use #WinActivateForce.

See GroupAdd for more details about window groups.


GroupAdd, GroupDeactivate, GroupClose, #WinActivateForce



GroupActivate "MyGroup", "R"