Path: utzoo!utgpu!news-server.csri.toronto.edu!eecg.toronto.edu!eric Newsgroups: comp.windows.ms.programmer From: eric@eecg.toronto.edu (Eric Smith) Subject: Return key in combo boxes. Message-ID: <1990Dec6.144321.12168@jarvis.csri.toronto.edu> Summary: Return key just beeps in combo boxes. Keywords: combo box keyboard Organization: EECG, University of Toronto Date: 6 Dec 90 19:43:21 GMT Lines: 33 Perhaps someone on the net has a solution or suggestion for the following problem: I am trying to set up WinWord-like combo boxes (with CBS_DROPDOWN | CBS_HASSTRINGS) to allow users to select fonts and sizes from the list part of the combo, or type them into the edit part. All is well, except that I want the return key to work the same way it does in WinWord, namely, it puts the current selection into the associated edit box, and undrops (hides) the list. In my application, typing return when the combo box has focus only causes a system beep--no notification message or anything. Of course, when the combo box has focus the main window proc receives no keyboard messages, so there's nothing to intercept at that point. Moreover, the Guide to Programming explicitly warns against subclassing predefined window classes (i.e. combo boxes), so messages can't be intercepted there either. Obviously since WinWord does it, it could be done, although I expect WinWord was written with the 2.0 API, so the authors probably used separate list box and edit box controls. One solution might be to use SetWindowsHook, but even if I could get that to work, it seems like overkill for such a simple problem. Thank you in advance for your help, Eric Smith Generic Design Systems Corporation (416) 236-0908 1199 Islington Ave. eric@eecg.toronto.edu Etobicoke, Ont. CompuServe: 72371,3015 M8Z 4T2 GEnie: E.SMITH29