Rewritten December 2023
tab(-10, AG_SYSCOLOR); id{,r,g,b}; chr(127); Tab(-10,x) Syntax Notes
AG_SYSCOLOR (63) allows you to query and/or change the Windows RGB color value for certain parts of the Windows user interface. Querying may be useful when creating your own controls (see AUI_CONTROL) in order to match the prevailing Windows color scheme. Changing the standard Windows colors, on the other hand, although supported, is not recommended due to:allows you to change the Windows RGB value for certain parts of the Windows user interface. Note that this is offered on an as-is basis, and is not recommended due to:
• | Conflicts between these settings and the current Theme |
• | Conflicts with the "approved" way of changing Windows desktop settings (via the Control Panel) |
• | Differences in the way it may work under different versions of Windows |
• | Possible problems with the way other applications may respond to the fact of color changes (since any such change triggers a notification message to be sent to all affected applications). |
That said, you can experiment as you wish.
Parameters
id
Identifier for the Windows user interface component, from the following table:
Symbol |
Value |
|
Symbol |
Value |
---|---|---|---|---|
COLOR_SCROLLBAR |
0 |
|
COLOR_HIGHLIGHTTEXT |
14 |
COLOR_BACKGROUND |
1 |
|
COLOR_BTNFACE |
15 |
COLOR_ACTIVECAPTION |
2 |
|
COLOR_BTNSHADOW |
16 |
COLOR_INACTIVECAPTION |
3 |
|
COLOR_GRAYTEXT |
17 |
COLOR_MENU |
4 |
|
COLOR_BTNTEXT |
18 |
COLOR_WINDOW |
5 |
|
COLOR_INACTIVECAPTIONTEXT |
19 |
COLOR_WINDOWFRAME |
6 |
|
COLOR_BTNHIGHLIGHT |
20 |
COLOR_MENUTEXT |
7 |
|
COLOR_3DDKSHADOW |
21 |
COLOR_WINDOWTEXT |
8 |
|
COLOR_3DLIGHT |
22 |
COLOR_CAPTIONTEXT |
9 |
|
COLOR_INFOTEXT |
23 |
COLOR_ACTIVEBORDER |
10 |
|
COLOR_INFOBK |
24 |
COLOR_INACTIVEBORDER |
11 |
|
|
|
COLOR_APPWORKSPACE |
12 |
|
COLOR_HOTLIGHT |
26 |
COLOR_HIGHLIGHT |
13 |
|
|
|
r, g, b
If specified, these red, green, and blue values will be combined to replace the color of the interface component specified by id. (0,0,0=black, 255,255,255=white)
Response
If the r,g,b parameters are specified (i.e. setting the color), there is no response. Otherwise the response is a comma-delimited list of the three current red, blue and green values followed by a carriage return:
r,g,b CR
Example
writecd tab(-10,AG_SYSCOLOR), COLOR_BTNFACE, 80, 120, 210; chr(127); ! set
writecd tab(-10,AG_SYSCOLOR), COLOR_BTNFACE; chr(127); ! query
input "", r, g, b
This first changes the color for the face of standard Windows buttons to RGB value (80,120,210). Then it queries the same element, which should send the response "80,120,210" CR
Comments
Note that if you are associating A-Shell palette numbers with the standard Windows dialog background, window background, or text (see AG_SYSBCLR), you must do that first before using the AG_SYSCOLOR command.