Skip to content

Latest commit

 

History

History
153 lines (102 loc) · 5.09 KB

nf-shlwapi-strtointexw.md

File metadata and controls

153 lines (102 loc) · 5.09 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:shlwapi.StrToIntExW
StrToIntExW function (shlwapi.h)
Converts a string representing a decimal or hexadecimal number to an integer. (Unicode)
STIF_DEFAULT
STIF_SUPPORT_HEX
StrToIntEx
StrToIntEx function [Windows Shell]
StrToIntExW
_win32_StrToIntEx
shell.StrToIntEx
shlwapi/StrToIntEx
shlwapi/StrToIntExW
shell\StrToIntEx.htm
shell
2e8286c7-585f-441b-904b-f3b4e8cf95f9
12/05/2018
STIF_DEFAULT, STIF_SUPPORT_HEX, StrToIntEx, StrToIntEx function [Windows Shell], StrToIntExA, StrToIntExW, _win32_StrToIntEx, shell.StrToIntEx, shlwapi/StrToIntEx, shlwapi/StrToIntExA, shlwapi/StrToIntExW
shlwapi.h
Windows
Windows 2000 Professional, Windows XP [desktop apps only]
Windows 2000 Server [desktop apps only]
StrToIntExW (Unicode) and StrToIntExA (ANSI)
Shlwapi.lib
Shlwapi.dll (version 4.71 or later)
Windows
19H1
StrToIntExW
shlwapi/StrToIntExW
c++
APIRef
kbSyntax
DllExport
Shlwapi.dll
API-MS-Win-Core-shlwapi-Obsolete-l1-1-0.dll
KernelBase.dll
API-MS-Win-Core-shlwapi-Obsolete-l1-2-0.dll
API-MS-Win-DownLevel-shlwapi-l1-1-0.dll
API-MS-Win-DownLevel-shlwapi-l1-1-1.dll
StrToIntEx
StrToIntExA
StrToIntExW

StrToIntExW function

-description

Converts a string representing a decimal or hexadecimal number to an integer.

-parameters

-param pszString [in]

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.

-param 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.

-param piRet [out]

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.

- dwFlags.STIF_DEFAULT

The string at pszString contains the representation of a decimal value.

- dwFlags.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.

-returns

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.
    (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.
    (optional white space)(optional sign)0x(one or more hexadecimal digits)
    (optional white space)(optional sign)0X(one or more hexadecimal digits)
The optional sign can be the character '-' or '+'; if omitted, the sign is assumed to be positive.
Note  If the value is parsed as hexadecimal, the optional sign is ignored, even if it is a '-' character. For example, the string "-0x1" is parsed as 1 instead of -1.
 
If the string pointed to by pszString contains an invalid character, that character is considered the end of the string to be converted and the remainder is ignored. For instance, given the invalid hexadecimal string "0x00am123", StrToIntEx only recognizes "0x00a", converts it to the integer value 10, and returns TRUE.

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.