LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using DWM with CVI Panels

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

0 Kudos
Message 1 of 2
(2,704 Views)

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:

 

NickB_05-19_09-16-47.png

 

and like this on a light background:

 

NickB_05-19_09-22-31.png

 

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):

 

NickB_05-19_09-23-51.png

 

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:

 

NickB_05-19_09-26-19.png

 

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

0 Kudos
Message 2 of 2
(2,636 Views)