Miscellaneous Features

Built-in Variables

A_IsUnicodeIn Unicode builds, this variable contains 1 (true). In ANSI builds it is not defined, so is effectively false.
A_FileEncodingContains the default encoding for various commands; see FileEncoding.
A_OSVersionContains WIN_7 on Windows 7, else one of the values documented here.
A_PtrSizeContains the size of a pointer, in bytes. On current builds, this is 4.

Changes to Commands

Unicode Script Files

If a UTF-8 or UTF-16 byte order mark is present in a script file, it is loaded as Unicode.

However, the following caveats apply:

Text Encodings

FileRead, FileReadLine, Loop Read and FileAppend support the majority of Windows-supported text encodings, not just the system default ANSI code page. FileEncoding can be used to set the default encoding, which can be overridden for FileRead and FileAppend as follows:

FileRead, OutputVar, *Pnnn Filename
FileAppend [, Text, Filename, Encoding]

While nnn must be a numeric code page identifier, Encoding follows the same format as FileEncoding.

See also: Script Compatibility

Send / ControlSend

Scripts may send Unicode characters one of the following ways:

This is achieved by using one of the following methods:

SetFormat

Hexadecimal digits A-F may be formatted in either lowercase or uppercase:

SetFormat, IntegerFast, H  ; UPPERCASE
SetFormat, IntegerFast, h  ; lowercase

Datatypes

Additional datatypes are available for use with NumGet, NumPut and/or DllCall.

Improvements to Icon Support

Unusual Sizes

Icon resources of any size supported by the operating system may be extracted from executable files. When multiple sized icon resources exist within an icon group, the most appropriate size is used. Prior to revision 17, an arbitrary icon resource was selected by the system, scaled to the system large icon size, then scaled back to the requested size.

Resource Identifiers

Negative icon numbers may be used to identify a group icon resource within an executable file. For example, the following sets the tray icon to the default icon used by ahk files:

Menu, Tray, Icon, %A_AhkPath%, -160

Text Quality

Text rendering quality on a script's Gui may be controlled by using Gui, Font, qN, where N is a number from the following table:

0 = DEFAULT_QUALITYAppearance of the font does not matter.
1 = DRAFT_QUALITYAppearance of the font is less important than when the PROOF_QUALITY value is used.
2 = PROOF_QUALITYCharacter quality of the font is more important than exact matching of the logical-font attributes.
3 = NONANTIALIASED_QUALITYFont is never antialiased, that is, font smoothing is not done.
4 = ANTIALIASED_QUALITYFont is antialiased, or smoothed, if the font supports it and the size of the font is not too small or too large.
5 = CLEARTYPE_QUALITYWindows XP and later: If set, text is rendered (when possible) using ClearType antialiasing method.

For more details of what these values mean, see MSDN: CreateFont.

Since the highest quality setting is usually the default, this feature is more typically used to disable anti-aliasing in specific cases where doing so makes the text clearer.