TreeView notifications fix

Dimitrie O. Paun dpaun at
Mon Mar 17 07:42:00 CST 2003

On March 17, 2003 06:57 am, Mike Hearn wrote:
> I know in November Dimi was having fun with this sort of thing, and that
> in Windows the listview at any rate reports this kind of thing
> incorrectly. Dimi, do you have any tips?

Yes, I don't think this patch is right. Here is the problem:

  Common controls send notifications back to the parent. 
  These notifications can be either Unicode or ANSI.
  The documented way of choosing which format to use is
  through the WM_NOTIFYFORMAT message, which is send to
  the parent upon control creation.

This sounds fairly simple, and it's exactly what our controls do.
Until sometimes in Nov 2002, when Aric Stewart posted this:
That is, it seems like the listview always sends notifications
in ANSI, no matter what you do! This obviously doesn't make much
sense, but Aric said he tested it, and that's how it works. As
a result he posted this patch, which latter got into the tree:

At the time I was trying to figure out a similar problem in the
Treeview, whereas putty broke when we did the 'right' thing and
started sending Unicode notifications. It seemed then obvious to
me that the fix would be to translate all notifications back to
ANSI, as in the listview case, but for some unknown reason that
did not fix Putty on my box, so I never sent the patch.
(BTW, if you want to play with this idea, the thing to do is
 to modify the get_notifycode() function, not the callers).

In Fec 2003, Drew "DanteAliegri" Ogle <dantealiegri at>
started looking into this problem, and I told him the story.
He wasn't too impressed (and rightfully so!), and he maintained
that the Unicode notifications are actually sent. I asked him
if he can run some tests, and he did. Here is what he found:

  So, this rather simple testcase shows that at least in XP..
  The executables are at
  atest recieves TVN_SELCHANGEDA
  and wtest recieves TVN_SELCHANGEDW

  Also ,
  may be useful.

  In the remarks section it addresses this problem.

I've attached the test program to this message, in case anyone
wants to play with it. It would be very interesing if people
ran the two executables that Drew provided on different versions
of Windows, and see what we get. Also, it would be more than
interesting if we could modify the tests to create a listview
instead, and see if the listview never sends a Unicode notification.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: text/x-makefile
Size: 834 bytes
Desc: not available
Url :
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 3191 bytes
Desc: not available
Url :

More information about the wine-devel mailing list