05-19-2011 02:36 AM
Hello,
I tried following example using with a CVI-Panel. (V8.5)
http://msdn.microsoft.com/en-us/library/bb688195%28VS.85%29.aspx
My aim is to extend the client area to the whole window and to put an additional button to the titlebar.
But this example seems not be working with CVI Panels.
I have installed all WinMsgCallbacks and so on but is seems not be working.
Has anybody used DWM with CVI Panels successfully?
Is this possible with CVI Panels?
Thanks
05-19-2011 09:32 AM
Hello -
While it is possible, you have to be careful how you extend the frame into the client area, and what type of CVI controls you place there. The main problem is that most CVI drawing is done with GDI, which does not utilize the alpha channel of colors when drawing. For an explanation, see the section "Drawing on Glass" of this article. For example, if you place a CVI button on a a portion of the frame extended into the client area, you'll end up with button text that looks like the following on a dark background:
and like this on a light background:
However, if you're willing to take care with what you draw and where you draw it, you can achieve some pretty neat results (this is a combination of DwmExtendFrameIntoClientArea and DwmEnableBlurBehindWindow):
I've only spent a little time playing around with some of this, so none of the examples I have are complete. I'll go ahead and attach one with the caveat that it is entirely unfishished and undoubtedly full of bugs... The example I've attached does not extend the frame into the entire client area, and it does not draw into the titlebar, but it does show the rather tricky DrawThemeTextEx API which I'm sure you'll want to use eventually. Here's a screenshot:
I'm not claiming to know much more than what I've just said, but nonetheless, if you have questions, feel free to ask.
NickB
National Instruments