views:

28

answers:

1

I'd like to add a menu to the glass part of the frame in a C++ application which is using WTL and Win32++. Those libraries are probably largely as this is something I'd need to do from Win32.

The latest versions of Opera and the upcoming Firefox are going to be doing this but I haven't been able to find a code example. Has anyone got examples of adding controls to glass that they can share? I guess an example of buttons and things like that are something I could work from.

I did some digging with WinSpy but I wasn't able to work out the exact controls Opera were using.

I'm targeting Windows Vista and 7 only.

Opera example: alt text

Example showing menu in Firefox 4 proposal (follow the link for more in their YouTube presentation: alt text

A: 

This WPF blog contains details on painting on non-client glass. Look at the "Office 2007 with Aero - Drawing in the NC area with glass" section for details; it's pretty toolkit-agnostic.

Basically, do your own window frame. Use WM_NCCALCSIZE to lie to Windows about the actual frame dimensions, then paint your own fake title bar using whatever extra controls you like. Hook the "window controls" up by reimplementing a WM_NCHITTEST handler.

ChrisV