exact situation is as follows: first I make am usual window (CreateWindow) and a DropDown Combo Box in it. I find the child Edit Box in this Combo Box and sub-class the Edit control. My hook procedure tests if Combo Box is dropped down, and if it is not, and WM_CHAR for Escape key is received, then the window is closed. Next, I have another usual window, and a DropDownList Combo Box in it. I sub-class this Combo Box (since it has NOT a child Edit Box !). My hook procedure tests if Combo Box is dropped down. If it is not, and WM_CHAR for Escape is received, the window is closed. The problem is, that when Combo Box is dropped down and I press Escape, the window closes. I think there is one extra WM_CHAR message. But what to do ? Sub-classing the List Box is difficult, since it is child window of the Desktop, not of the Combo Box....and may be not needed ??
Posted on 2001-06-04 06:51:00 by ivogelov
the problem is that the OS first close dropdown list and then send ur prog WM_CHAR
Posted on 2001-06-07 19:53:00 by Alexey
I thought this may be the problem, but wasn't sure. So, what to do in this case ? I'm doing my dialogs directly - I use CreateWindowEx and then sub-class controls and use IsDialogMessage to handle TAB, Shift+TAB, Enter, Esc, arrows. I DON'T want to use dialog resources since they work in dialog units and I want to use pixels instead (if you know what I'm talking about). I just thought this work around: I test if Combo Box is dropped. If it is, then I call DefWindowProc. If it isn't, I test whether TAB, Enter, Esc ... is pressed and do appropriate actions. But now I will not call DefWindowProc, but will test if Esc is pressed, and if so, SendMessage to make Combo Box not dropped. I hope this will remove the specified "bug" in Combo Box....
Posted on 2001-06-10 03:39:00 by ivogelov