Args
ARG(1) indicates whether the window is being activated or deactivated. It is one of the following values:
Value Meaning 0 Deactivated. 1 Activated by some method other than the user clicking the mouse on the window (for example, by a call to GuiSetCtlPlacement to activate the window, or by the user utilizing the keyboard interface to select the window). 2 Activated by a mouse click.
ARG(2) indicates the minimized state of the window being activated or deactivated. A nonzero value indicates the window is minimized.
ARG(3) is the handle of the window being activated or deactivated.
Return
An empty string to prevent the window from getting the focus. You can then activate the window of your choice with GuiSetCtlPlacement. Return nothing to allow the window to have the keyboard focus.
Notes
If you have more than one simultaneously open window, then when the user activates one of your windows, then the other window will have an ACTIVATE event with ARG(1) = 0, and then the window the user clicked on will have an ACTIVATE event with ARG(1) = 1 or 2.
If you wish to know whether some other program's window has been activated, then handle the ACTIVATEAPP message.
If the window is activated by a mouse click, a MOUSEACTIVATE event subsequently happens.
See also MOUSEACTIVATE, NCACTIVATE, ACTIVATEAPP, SETFOCUS.