Huw Davies huw@codeweavers.com wrote:
- SendMessageW(hwnd, WM_GETTEXT, sizeof(buf) / sizeof(buf[0]), (LPARAM)buf);
- if (IsWindowUnicode(hwnd))
ok(memcmp(buf, unistring, sizeof(unistring)) == 0, "WM_GETTEXT invalid return\n");
- else
ok(memcmp(buf, unistring, sizeof(unistring)) != 0, "WM_GETTEXT invalid return\n");
This doesn't look right. SendMessageW(WM_GETTEXT) is supposed to always return a unicode string regardless of wheather IsWindowUnicode() is broken or not, otherwise a lot of applications would misbehave in weird ways. This needs further investigation.
Exactly, the reason I added that bit was to show that this behaviour is truly broken.
Sorry, but I can't believe that such a basic functionality like returning a unicode string using SendMessageW(WM_GETTEXT) is actually broken. Any UI uses it to retrieve and pass strings around for various purposes from getting username/password/regisration to getting random user input, so if it would be broken that would mean a lot of applications/installers/UI libraries/etc. were broken, and that wouldn't stay unnoticed.