[Bug 7512] Problem with unicode comboboxes

Wine Bugs wine-bugs at winehq.org
Wed Jul 11 09:54:07 CDT 2007


http://bugs.winehq.org/show_bug.cgi?id=7512





------- Additional Comments From dmda at yandex.ru  2007-11-07 09:54 -------
>Your understanding is not really correct. There are tests in Wine that show
>that Wine behaves correctly in treating ANSI/Unicode window procs. It appears
>that Windows has an extra hack, probably to make broken code like in library
>you are using work.

no, I'm not saying that Windows is good and Wine is broken.
I'm far from this.
>From the advertized policy, Wine stands to have bug-for-bug compatibility with 
Windows.

Regarding if this "bug" or not, my thoughts are below. You can make decision 
if that's a bug in Windows or not, not me. Please just check with code I 
provided. Basicly it can be viewed as follows:
A combobox constrol is created. 
Some "stupid" calls are performed on it. 
After all we ask - hey, are you unicode? It reports YES. We may also ask, is 
your editor unicode? It confirms too. Then we call UNICODE function 
SetWindowTextW() providing UNICODE string L"test" and our control treats it as 
ANSI. Isn't it a bug?

  ComboHandle = CreateWindowExW(0, L"COMBOBOX", 0, 0x44210242, 55, 30, 190, 
21, ParentWnd, 0, HInstance, 0);
  ShowWindow(ComboHandle, SW_NORMAL);

// stupid calls begin:
  EditHandle = GetWindow(ComboHandle, GW_CHILD);
  DefEditProc = GetWindowLongA(EditHandle, GWL_WNDPROC);
  SetWindowLongA(EditHandle, GWL_WNDPROC, DefEditProc);
// stupid calls end.
  SetWindowLongW(EditHandle, GWL_WNDPROC, GetWindowLongA(EditHandle, 
GWL_WNDPROC)); // this call is a fixup to trigger EditHandle into unicode and 
  IsWindowUnicode(ComboHandle); // <- returns TRUE
  IsWindowUnicode(EditHandle);  // <- returns TRUE
  SetWindowTextW(ComboHandle, L"Any Text"); // prints only "A" 
  SetWindowTextW(ComboHandle, (wchar_t*)"Any Text"); // prints "Any Text" 


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the wine-bugs mailing list