LPSTR AnsiUpper(lpszString) | |||||
LPSTR lpszString; | /* address of string, or specific character | */ |
The AnsiUpper function converts the given character string to uppercase.
lpszString
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.
The return value points to a converted character string if the function parameter is a character string. Otherwise, the return value is a 32-bit value that contains the converted character in the low-order byte of the low-order word.
The language driver makes the conversion for the current language (the one selected by the user at setup or by using Control Panel). If no language driver is selected, Windows uses an internal function.
The following example uses the AnsiUpper function to convert two strings to uppercase for a non–case-sensitive comparison:
/*
* Convert the target string to uppercase, and then
* convert the subject string one character at a time.
*/
AnsiUpper(pszTarget);
while (*pszTarget != '\0') {
if (*pszTarget != (char) (DWORD) AnsiUpper(
MAKELP(0, *pszSubject)))
return FALSE;
pszTarget = AnsiNext(pszTarget);
pszSubject = AnsiNext(pszSubject);
}