#OPTION metastatement

Purpose

Set the minimum Windows version requirements for your program.

Syntax

#OPTION {VERSION3 | VERSION4 | VERSION5}

Remarks

The #OPTION metastatement controls the "minimum Windows version" tag that is written into your compiled code.  If the version you select is equal or lower to the version of Windows that is running, the application will be executed.  In turn, Windows will tailor the messages it sends to your program according to this version number, so your program will not need to handle messages from a later Windows version.  The version tag may also affect the appearance and behavior of Windows common dialogs.

Conversely, if the version tag you select is higher than the version of Windows that is running, Windows will display an error message instead of running your application.  For example, running a VERSION5 application on a VERSION4 platform would fail. It is your responsibility to make sure that your program only uses the Windows features that are present in the specified version of Windows. For example, don’t call an API that’s present only in Windows XP, if you want your program to run under Windows 98.

Use #OPTION VERSION3 to make the compiled output file require a minimum of Windows 95 or NT 3.1. That includes Windows 95, 98, ME, Windows NT 3.1-4.0, Windows 2000, XP, Windows 2003 (and later).  Use #OPTION VERSION4 (default) to make the compiled output file require a minimum of Windows 95 or NT4. That includes Windows 95, 98, ME, Windows NT 4.0, Windows 2000, XP, Windows 2003 (and later).  Use #OPTION VERSION5 to make the compiled output file require a minimum of Windows 2000. That includes Windows 2000, XP, Windows 2003 (and later).

Example

#OPTION VERSION5