TreeView notifications fix

Dimitrie O. Paun dpaun at rogers.com
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:
    http://www.winehq.com/hypermail/wine-devel/2002/11/1167.html
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:
    http://www.winehq.com/hypermail/wine-patches/2002/11/0276.html

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 umbc.edu>
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  http://open-socket.dyndns.org/~dante/execs.tar.bz2
  atest recieves TVN_SELCHANGEDA
  and wtest recieves TVN_SELCHANGEDW

  Also ,
  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/CommCtls/Common/Messages/WM_NOTIFYFORMAT.asp
  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.

-- 
Dimi.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: text/x-makefile
Size: 834 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20030317/6ca410b3/Makefile.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 3191 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20030317/6ca410b3/test.c


More information about the wine-devel mailing list