I have a window, which is used as a dialog box. There are Buttons, Edit boxes, List View and Combo boxes. All of them are subclassed and when Escape is pressed, the window is closed. But there is a problem with Combo boxes. If they are DropDown, subclassing is OK. If they are DropDownList, when I press ESC, its ListBox hides but my sub-class window procedure receives a WM_CHAR with ESC key. I can not understand why this is happening. If someone can help me, this is very strange .... Thanks in advance, folks !
dont know exactly, but keep in mind, that a combobox consists of three windows. The main combobox window, its edit window and its (non-child and popup) listbox. Maybe you have to subclass all the three windows.
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 ??
When you press ESC DlgProc recieve msg: wParam = 2, lParam = 0 So u may don't hook controls to process this mesg
I think I've thought a work around for my problem. Anyway, thanks all folks for the help.