I want to create a Window like when a context menu pops up or clicking the menubar. I want a Window that will be like this and that I can take over its paint event. Sort of like what is created when you select a sub tool in Photoshop.
EDIT:I want to know how to create controls like the one that comes when you select a sub tool in Photoshop, these do not seem to have a parent window. Those little description popups are a good example of this type of window, and menu items, those rectangles have no parent window.
Thanks
EDIT2: see this: http://cdn-viper.demandvideo.com/media/CB3C805F-421E-45AE-8359-39D59D8F0165/jpeg/20412728-192C-462A-AF8E-1F30BA77AE05_2.jpg
You will notice the window for the sub tools, it is not constrained to a parent window.
That’s your real question.
There are several ways of getting the shadow. One is that the window is actually two windows, the “shadow” plus the “main” window.
When you create the flyout window (that’s what it’s called), you position it near the toolbar. If the toolbar gets a
WM_MOVEmessage, it’s your responsibility to callMoveWindow()on the flyout to keep it lined up.Edited to add
The
dwExStyleparameter ofCreateWindowEx()should includeWS_EX_LAYEREDand probablyWS_EX_TRANSPARENT, because the ‘shadow’ will use alpha blending. ThehWndParentparameter is the application’s main window. Thexandyparameters must be calculated as an offset of whatever button the window is to be associated with.