Am 16.11.2011 16:12, schrieb victor martinez:
>The Total Commander comboboxes for the left and right drive list
>are Unicode. However, Total Commander calls
>SendMessage(handle,CB_ADDSTRING,0,(LPARAM)ansitext);
>to add items as ANSI text. This seems to work, but it's adding some
>extra text at the end.

If I understand correctly, Total Commander is calling SendMessage, which in
this case is translated to SendMessageW (as the comboboxes are Unicode).
No, the fact that the combo boxes are unicode, doesn't mean TC is calling SendMessageW, It could very well call SendMessageA and pass an ansi string.
If it passes an ANSI string to SendMessageW then it's doing it wrong.
The message is supposed to be translated accordingly when it's passed to the recevier, based on whether the receiving window is ANSI or unicode.

The problem also doesn't seem to be ANSI vs unicode, but the "extra text at the end".
First thought: someone forgot that UNICODE_STRINGs are not neccessarily 0 terminated.

Timo