- owner-draw menus cosmetic problem
- Posted by Clint Weisbrod on October 13th, 2003
Hi All,
I have some code that implements owner-draw menus and for the most
part, it is what I was shooting for. However, I'm having trouble with
one thing in particular:
Although my dropdown menu items are drawn as I want them, the entire
dropdown menu itself (the container for all the menu items in the
menu) appears to be a window with small beveled edges that I cannot
modify. This is rather disappointing since the whole idea is to take
control over drawing the menu. However, all one really has control
over is how the individual items within a menu are drawn.
Does anyone know how I can modify the appearance of the window that
contains the menu items?
Thanks very much.
Clint Weisbrod.
- Posted by Tim Robinson on October 13th, 2003
Unfortunately the appearance of menu borders is hard-coded quite deep inside
Windows, and as you've seen, you can't change that using normal owner-draw
techniques.
The Platform SDK includes the FAKEMENU sample which draws its own menu from
scratch. It seems to simulate a Windows 2000-style menu pretty well and,
with some modification, could simulate a Windows XP menu too.
--
Tim Robinson (MVP, Windows SDK)
http://www.themobius.co.uk/
"Clint Weisbrod" <cweisbrod@cogeco.ca> wrote in message
news:38d114d6.0310130659.2f3e57b5@posting.google.c om...
- Posted by Elias Fotinis on October 14th, 2003
Clint Weisbrod wrote:
You could setup a CALLWNDPROC hook to catch WM_CREATE messages for the
menus and subclass them (the menu window class is "#32768", iirc). Then,
in the new wndproc, you could handle WM_NCPAINT and WM_PRINT to draw the
border (WM_PRINT is needed for menu effects). I've managed to do that in
XP, but in 2K it doesn't work well. Even so, there were still several
bugs in XP I couldn't solve so I stopped the experiments 
You could search in CodeProject for 'owner-draw' or 'cool' menus. You'll
find several implementations, although the ones I've tested are not
perfect.