http://msdn.microsoft.com/library/ [...] s_6g1c.htm
lstrcmp
The lstrcmp function compares two character strings. The comparison is case sensitive.
To perform a comparison that is not case sensitive, use the lstrcmpi function.
int lstrcmp(
LPCTSTR lpString1, // first string
LPCTSTR lpString2 // second string
);
Parameters
lpString1
[in] Pointer to the first null-terminated string to be compared.
lpString2
[in] Pointer to the second null-terminated string to be compared.
Return Values
If the string pointed to by lpString1 is less than the string pointed to by lpString2, the return value is negative. If the string pointed to by lpString1 is greater than the string pointed to by lpString2, the return value is positive. If the strings are equal, the return value is zero.
Remarks
The lstrcmp 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, lstrcmp determines that "abcz" is greater than "abcdefg" and returns the difference of z and d.
The language (locale) selected by the user at setup time, or through Control Panel, determines which string is greater (or whether the strings are the same). If no language (locale) is selected, the system performs the comparison by using default values.
With a double-byte character set (DBCS) version of the system, this function can compare two DBCS strings.
The lstrcmp function uses a word sort, rather than a string sort. A word sort treats hyphens and apostrophes differently than it treats other symbols that are not alphanumeric, in order to ensure that words such as "coop" and "co-op" stay together within a sorted list. Note that in 16-bit versions of Windows, lstrcmp uses a string sort. For a detailed discussion of word sorts and string sorts, see the Remarks section of the reference page for the CompareString function .
Requirements
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.