[ros-dev] SendMessageW doubt/bug with ANSI LPARAM.

Timo Kreuzer timo.kreuzer at web.de
Wed Nov 16 20:14:07 UTC 2011


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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.reactos.org/pipermail/ros-dev/attachments/20111116/d7d34e72/attachment.htm>


More information about the Ros-dev mailing list