- Is it possible to reposition window's menu bar?
- Posted by Alex Blekhman on April 7th, 2008
Hello,
I have a requirement to make custom non-client area for main
window. I handle the WM_NCPAINT message and draw window frame
including window caption correctly. However, window's menu bar
cannot be replaced and happens to be under the caption (custom
caption is higher than the system one).
I tried to make owner-draw menu following the description from
MSDN:
"Using Menus" (section "Creating Owner-Drawn Menu Items")
http://msdn2.microsoft.com/en-us/library/ms647558.aspx
However, I never get a chance to set new position for the menu
bar. All I get is the WM_MEASUREITEM message where I can set
height and width of individual menu item. And then the WM_DRAWITEM
message where I should draw the item on a given DC.
I have no problem to draw menu items' text at the arbitrary
location of non-client area, but I cannot cause it to behave like
a menu bar. Handling WM_NCHITTEST and returning HTMENU has no
effect whatsoever. Should I handle the WM_NCLBUTTONDOWN message,
too? Any other messages?
I'll appreciate any advice.
Thanks
Alex
- Posted by Kellie Fitton on April 7th, 2008
On Apr 7, 10:26*am, "Alex Blekhman" <tkfx.REM...@yahoo.com> wrote:
Hi,
Well, one viable option is replacing the menu bar with a control
of your own, or a toolbar and handle the Windows notification
TBN_DROPDOWN. In other words, you have to roll your own
design menu bar and dock it any where you want on the parent
window. You can even create the menu bar as a floating menu
bar where the end-user can move it around on the screen.
http://msdn2.microsoft.com/en-us/library/ms650670.aspx
http://msdn2.microsoft.com/en-us/library/ms672056.aspx
http://msdn2.microsoft.com/en-us/library/ms672057.aspx
Kellie.
- Posted by Alex Blekhman on April 7th, 2008
"Kellie Fitton" wrote:
Yes, I know I could use a toolbar. Are you aware of any other
option?
Thanks
Alex