I have a program, I'll call it 'SS'. SS stores its information in a database. I'm developing an administration program to create databases for SS to use. I need to let the user choose where the database should be stored. Because the database server has to store the database, and not the local machine, I can't use a typical browse-for-folder dialog, since they work off the users's machine. I have a TreeView control and am perfectly able to populate it with the server's directory sturcture. However, tree views can be fairly big - so I'd really like to be able to make it appear at the click of a button, much like the list box part of a CBS_DROPDOWN/CBS_DROPDOWNLIST combo box.

My question is, how does the combo box accomplish this feat? After some simple observations, you'll see that the combo box is able to draw its list area OUTSIDE of its owner's window area - quite a feat, given that Windows doesn't generally let applications do such things.

Another thing is that clicking outside the list area will close the list back up. I tried using the LostFocus event, but that only works if the user clicks another control. If the user clicks the form, or a windowless 'control' (i.e. Line, Shape, Label, Image), nothing happens.