StrToIntExW function (shlwapi.h)
Converts a string representing a decimal or hexadecimal number to an integer.
Syntax
BOOL StrToIntExW(
[in] PCWSTR pszString,
STIF_FLAGS dwFlags,
[out] int *piRet
);
Parameters
[in] pszString
Type: PCTSTR
A pointer to the null-terminated string to be converted. For further details concerning the valid forms of the string, see the Remarks section.
dwFlags
Type: STIF_FLAGS
One of the following values that specify how pszString should be parsed for its conversion to an integer.
STIF_DEFAULT
The string at pszString contains the representation of a decimal value.
STIF_SUPPORT_HEX
The string at pszString contains the representation of either a decimal or hexadecimal value. Note that in hexadecimal representations, the characters A-F are case-insensitive.
[out] piRet
Type: int*
A pointer to an int that receives the converted string. For instance, in the case of the string "123", the integer pointed to by this value receives the integer value 123.
If this function returns FALSE, this value is undefined.
If the value returned is too large to be contained in a variable of type int, this parameter contains the 32 low-order bits of the value. Any high-order bits beyond that are lost.
Return value
Type: BOOL
Returns TRUE if the string is converted; otherwise FALSE.
Remarks
The string pointed to by the pszString parameter must have one of the following forms to be parsed successfully.
- This form is accepted as a decimal value under either flag. ``` syntax (optional white space)(optional sign)(one or more decimal digits) ```
- These forms are required for hexadecimal values when the STIF_SUPPORT_HEX flag is passed.
``` syntax
(optional white space)(optional sign)0x(one or more hexadecimal digits)
```
(optional white space)(optional sign)0X(one or more hexadecimal digits)
Note
The shlwapi.h header defines StrToIntEx as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional, Windows XP [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | shlwapi.h |
Library | Shlwapi.lib |
DLL | Shlwapi.dll (version 4.71 or later) |