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.
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.
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.
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).
GetPrivateProfileInt, GetProfileString, GetPrivateProfileString