¶Silly Win32 UI bug #29,756
In VirtualDub 1.8.5, there is a bug where if you try to edit the name of a job in the job control dialog, the job control dialog disappears as soon as you type any character.
Needless to say, I was rather confused when I received this bug report... partly because I didn't realize anyone actually used this feature, and partly because I couldn't think of what would cause it.
It turns out that this bug is caused by a somewhat poor choice of ID in the Windows ListView common control. When the user clicks on a ListView entry to edit its label, the ListView creates a child edit control. There are two problems with the way it does this:
- The ListView forwards most of the child edit control's WM_COMMAND notifications up to the parent.
- The edit control uses an ID of 1, which happens to be the same as IDOK.
The result is that the job control dialog receives an EN_CHANGE notification as a WM_COMMAND message with a control ID of IDOK and thinks it's time to close the dialog box. Whoops. Funny how they left this little detail out of the MSDN documentation....
Old versions of VirtualDub didn't have this problem because the job control dialog handled WM_COMMAND notifications in a different way. A little message filtering will fix the problem in 1.8.6.