[ros-kernel] Re: Status of Explorer under ReactOS - Bug #42 (I know
the fix)
Martin Fuchs
martin-fuchs at gmx.net
Sat Nov 8 12:53:57 CET 2003
Hello Jonathan,
> Basicly, if the window procedure is Unicode, it should be sent unicode
> messages no matter what is passed in and vice versa.
> Looks like somehow, when all the work I did for unicode messages was done,
> SendMessage wasnt fixed.
I inserted debug messages, and got his trace:
XXX User32CallWindowProcFromKernel: CallbackArgs->wParam=1024
XXX CallWindowProcA WM_GETTEXT ANSI: wparam=1024
[button] ButtonWndProc called : msg 13
XXX ButtonWndProc_common unicode=1: wParam=1024
XXX WM_GETTEXT W: WindowText=Start wparam=1024
XXX WM_GETTEXT W: (PWSTR)lParam=Start ret=5
XXX ButtonWndProc_common unicode=1: ret=5 (LPWSTR)lParam=Start
XXX CallWindowProcA WM_GETTEXT ANSI: ret=5 (LPSTR)lParam=S
XXX User32CallWindowProcFromKernel: (PWSTR)CallbackArgs->lParam=S ret=5
XXX MsgiAnsiToUnicodeReply WM_GETTEXT: Buffer=S (LPSTR)Buffer=S *Result=5
XXX MsgiAnsiToUnicodeReply WM_GETTEXT: AnsiBuffer=S
Your code in MsgiAnsiToUnicodeMessage() and MsgiAnsiToUnicodeReply() is correct. Also SendMessageA() and CallWindowProcA() do what they should do.
It is a bit more difficult. There is not only one window procedure in this case, because the windows are subclassed. The current window procedure is in explorer itself. This is not Unicode when using the ANSI version of Explorer. The other window procedure is part of USER32. This ButtonWndProcW() is Unicode. When deciding to use the translation with MsgiAnsiToUnicodeMessage()/MsgiAnsiToUnicodeReply() you call IsWindowUnicode(). This returns FALSE because it is set in NtUserSetWindowLong() when subclassing the window.
The solution would be to use either Unicode or Ansi for all window procedure of any window. I will try to use ButtonWndProcA() instead of ButtonWndProcW() if CreateWindowExA() is used. I think this sould work.
--
Martin Fuchs
martin-fuchs at gmx.net
More information about the Ros-kernel
mailing list