13.7 The EXETYPE Statement

The EXETYPE statement specifies under which operating system the application or DLL is to run. This statement is optional and provides an additional degree of protection against the program being run under an incorrect operating system.

Syntax

EXETYPE [[OS2 | WINDOWS[[version]] | UNKNOWN]]

Remarks

The EXETYPE keyword is followed by a descriptor of the operating system, either OS2 (for OS/2 applications and DLLs), WINDOWS (for WINDOWS applications and DLLs), or UNKNOWN (for other applications). The default without a descriptor or an EXETYPE statement is OS2.

EXETYPE sets bits in the header which identify the operating system. Operating-system loaders can check these bits.

Windows Programming

The WINDOWS descriptor takes an optional version number. Windows reads this number to determine the minimum version of Windows needed to load the application or DLL. For example, if 3.0 is specified, the resulting application or DLLcan run under Windows versions 3.0 and higher. If version is not specified, the default is 3.0. The syntax for version is

number[[.[[number]] ]]

where each number is a decimal integer.

In Windows programming, use the EXETYPE statement with a PROTMODE statement to specify an application or DLL that runs only under protected-mode Windows.