GetProfileInt

Syntax

WORD GetProfileInt(lpAppName,lpKeyName,nDefault)

This function retrieves the value of an integer key from the Windows initialization file, WIN.INI. The function searches WIN.INI for a key that matches the name specified by the lpKeyName parameter under the application heading specified by the lpAppName parameter. An integer entry in WIN.INI must have the following form:

[application name]

keyname = value

.

.

.

Parameter Type/Description  

lpAppName LPSTR Points to the name of a Windows application that appears in the Windows initialization file.  
lpKeyName LPSTR Points to a key name that appears in the Windows initialization file.  
nDefault int Specifies the default value for the given key if the key cannot be found in the Windows initialization file.  

Return Value

The return value specifies the result of the function. The return value is zero if the value that corresponds to the specified key name is not an integer or if the integer is negative. If the value that corresponds to the key name consists of digits followed by nonnumeric characters, the function returns the value of the digits. For example, if the entry KeyName=102abc is accessed, the function returns 102. If the key is not found, this function returns the default value, nDefault.