In finite element analysis preprocessing, a timestep might have several load sets assigned to it. A useful control for this is a multiselect combobox, which allows typing the comma separated list of ID's in the edit box, or selecting them from a popup multi-selection listbox. The listbox can be popped down by the usual methods (Alt-F4, Esc, Deactivate).

There is one difficulty which must be overcome, namely that the interface between the listbox and its parent window is undocumented and has unexpected behavior. The presence of the modal dialog containing the popup activation button is presumably a factor. Under XP, a parent modal dialog destroys itself if GetDlgItem is called in the WM_INITDIALOG routine. A parent window works better, but selecting an item in the list causes mutliple WM_DESTROY's to be sent to the parent.

A solution to this problem is to create the popup in a separate thread. Example code can be downloaded; this is free software and may be used without restriction.

Two annoyances remain. The default button border is drawn around the activation button when the popup is destroyed, after the WM_ACTIVATE message is processed by the dialog procedure. This is standard Windows behavior, but it would be more useful if the focus was set to the edit box; this doesn't work if done in the activate message. The window appears on the toolbar; this can be corrected but I have not put this code in yet.