GetProfileInt

  UINT GetProfileInt(lpszSection, lpszKey, dwDefault)    
  LPCTSTR lpszSection; /* address of the section name */
  LPCTSTR lpszKey; /* address of the keyname */
  DWORD dwDefault; /* return value if keyname is not found */

The GetProfileInt function retrieves the value of an integer from a specified keyname within a specified section of the WIN.INI initialization file.

Parameters

lpszSection

Points to a null-terminated string that specifies the section containing the key name.

lpszKey

Points to the null-terminated string containing the keyname whose value is to be retrieved.

dwDefault

Specifies the default value to return if the keyname cannot be found.

Return Value

If the function is successful, The return value is the value of the string following lpszKey in WIN.INI. If the key is not found, the return value is dwDefault.

The return value is zero if the keyname value is negative.

If the key name consists of digits followed by nonnumeric characters, the function returns the value of the digits. For example, the function would return 102 for the line KeyName=102abc.

Comments

The GetProfileInt function may be used as either a wide-character function (where text arguments must use Unicode) or an ANSI function (where text arguments must use characters from the Windows 3.x character set installed).

See Also

GetPrivateProfileInt, GetProfileString, GetPrivateProfileString