# AG\_FOREGROUND

> [HTML Version](ag_foreground.htm)

_Rewritten May 2025; see History_

**? tab(-10, AG\_FOREGROUND); opcode; chr(127);**     [Tab(-10,x) Syntax Notes](ag_xxx_syntax-notes.md)

AG\_FOREGROUND (78) allows the application to test whether the client (A-Shell Windows or ATE) is in the foreground (opcode 0), or to force it into the foreground (opcode 1). Note that this function was formerly named AG\_ISFOREGROUND.

**Parameters**

_opcode_

optionally indicates the operation (if omitted, 0 is assumed):

| **Value** | **Action** |
|------|------|
| 0 | returns response indicating if client is in the foreground or not |
| 1 | force client into foreground status (and display its window if minimized |


**Response**

(opcode 0):  "0" or "1" followed by a carriage return (for not in foreground, in foreground, respectively)

(opcode 1):  no response

**History**

2025 May, A-Shell 7.0.1772:  Add optional _opcode_ parameter so that it can be used to set the foreground as well as detect it.