lstrcmpi

  int lstrcmpi(lpszString1, lpszString2)    
  LPCTSTR lpszString1; /* address of first string */
  LPCTSTR lpszString2; /* address of second string */

The lstrcmpi function compares two character strings. The comparison is not case sensitive.

Parameters

lpszString1

Points to the first null-terminated string to be compared.

lpszString2

Points to the second null-terminated string to be compared.

Return Value

The return value is negative if the string specified in lpszString1 is less than the string specified in lpszString2, is positive if lpszString1 is greater than lpszString2, and is zero if the two strings are equal.

Comments

The lstrcmpi function compares two strings by checking the first characters against each other, the second characters against each other, and so on until it finds an inequality or reaches the ends of the strings. The function returns the difference of the values of the first unequal characters it encounters. For example, lstrcmpi determines that “abcz” is greater than “abcdefg” and returns the difference of “z” and “d”.

The language driver for the language selected by the user determines which string is greater (or whether the strings are the same). If no language driver is selected, Windows uses an internal function.

With a double-byte character set (DBCS) version of Windows, this function can compare two DBCS strings.

See Also

lstrcmp