Newsgroups: comp.windows.ms.programmer
Path: utzoo!utgpu!watserv1!watmath!hyper.hyper.com!bonneau
From: bonneau@hyper.hyper.com (Paul Bonneau)
Subject: Re: What don't I understand about ComboBoxes?
Message-ID: <1991Mar16.184224.18694@hyper.hyper.com>
Reply-To: bonneau@hyper.UUCP (Paul Bonneau,,)
Organization: HyperCube Inc.
References: <55579@siemens.siemens.com>
Date: Sat, 16 Mar 1991 18:42:24 GMT

In article <55579@siemens.siemens.com> jrv@demon.siemens.com writes:
>The 'head' program in the book creates two child windows in the client area:
>one static to display a file name, and the other as a List box of file names.
>I changed the List Box to a Combo box.  The program more or less works (I
>still don't quite have the keyboard interface functioning correctly.)  but
>there is something weird which I do not understand.
>
>If the list box is dropped down under the edit box, and I move the window on
>the screen everything except the list box part of the combo box moves.  I
>can slide the window right out from under the list box.  If the window is
>minimized the list box is removed but when brought back the list box is in
>the same place outside of the client area of its parent window.  Why does
>this control seem to break up into multiple parts?  Shouldn't it all at
>least stay within the client area of the control's parent?
>
I am pretty sure your problem is that the windows dialog
manager is not being used to control the combo.  Normally,
a mouse click anywhere outside the dropped list will collapse
it.

So, if you call IsDialogMessage() in your main message loop with
the window handle of the combo's parent, things should work much
better.  IsDialogMessage() allows the dialog manager to interpret
messages for control-specific interaction.

cheers - Paul Bonneau.
