AnsiLower

2.x

  LPSTR AnsiLower(lpsz)    
  LPSTR lpsz; /* address of string, or specific character */

The AnsiLower function converts a character string to lowercase.

Parameters

lpsz

Points to a null-terminated string or specifies a single character. If the high-order word of this parameter is zero, the low-order byte of the low-order word must contain a single character to be converted.

Return Value

The return value points to a converted character string if the function is successful. Otherwise, the return value is a 32-bit value that contains the converted character in the low-order byte of the low-order word.

Comments

The conversion is made by the language driver for the current language (the one selected by the user at setup or by using Control Panel). If no language driver has been selected, Windows uses an internal function.

Example

The following example uses the AnsiLower function to convert two strings to lowercase for a non–case-sensitive comparison:

/*
 * Convert the target string to lowercase, and then
 * convert the subject string one character at a time.
 */

AnsiLower(pszTarget);
while (*pszTarget != '\0') {
    if (*pszTarget != (char) (DWORD) AnsiLower(
            MAKELP(0, *pszSubject)))
        return FALSE;
    pszTarget = AnsiNext(pszTarget);
    pszSubject = AnsiNext(pszSubject);
}

See Also

AnsiLowerBuff, AnsiNext, AnsiUpper