CharPrevExA function

Retrieves the pointer to the preceding character in a string. This function can handle strings consisting of either single- or multi-byte characters.

Syntax

LPSTR CharPrevExA(
  WORD   CodePage,
  LPCSTR lpStart,
  LPCSTR lpCurrentChar,
  DWORD  dwFlags
);

Parameters

CodePage

Type: WORD

The identifier of the code page to use to check lead-byte ranges. Can be one of the code-page values provided in Code Page Identifiers, or one of the following predefined values.

Value Meaning
CP_ACP
0
Use system default ANSI code page.
CP_MACCP
2
Use the system default Macintosh code page.
CP_OEMCP
1
Use system default OEM code page.

lpStart

Type: LPCSTR

The beginning of the string.

lpCurrentChar

Type: LPCSTR

A character in a null-terminated string.

dwFlags

Type: DWORD

This parameter is reserved and must be zero.

Return Value

Type: LPSTR

The return value is a pointer to the preceding character in the string, or to the first character in the string if the lpCurrentChar parameter equals the lpStart parameter.

Remarks

CharPrevExA specifies a code-page to use, whereas CharPrev (if called as an ANSI function) uses the system default code-page.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

CharNextExA

CharPrev

Conceptual

Reference

Strings