Has anyone tried adding theme support to an app with a tab control? When you do you will notice that the dialog, which is a child of the tab control, doesn't get painted with that nice gradient texture, it just shows up with COLOR_BTNFACE. Of course its easy to fix that by simply returning a NULL_BRUSH in response to WM_CTLCOLORDLG to make the dialog transparent. Now that you feel confident that youve solved the tab control mistery try adding some checkboxes, radio buttons, or group boxes to the tab page. Now you have the same prolem as before, the COLOR_BTNFACE background. But we know how to fix that right? All we gotta do is return a NULL_BRUSH in response to WM_CTLCOLORSTATIC right ? WRONG !!! When I attept to do this all my checkboxes/radio buttons turn completely black (but regular static controls work ok) and the group box is trasparent, but because its transparent you see this line running through the static control!! Right click my computer and hit properties, see the pretty tab pages all themed up?? how did they do that?!?!
Posted on 2003-01-05 19:28:12 by BubbaFate
ok ppl, i found a work around for the problem. All you gotta do is create a property sheet instead of a tab control. BUT this sucks because property sheets add those "Ok, Cancel, Apply" buttons to your window. It also adds a help button, and I cant seem to get a minimize button added to the window either. Im sure there is a remedy for all of these problems, but its certainly a lot harder to customize the appearance of a property sheet than a tab control... so I would still appreciate any info on getting just a regular tab control to work...
Posted on 2003-01-05 21:27:48 by BubbaFate
Ok, now that ive played with it enough its actually pretty easy to customize a property sheet.... one could even argue that its easier than using a regular tab control so I'll shutup now
Posted on 2003-01-05 23:04:07 by BubbaFate
This seem odd, even form Micro$oft. What are you up to..?

Posted on 2003-01-05 23:08:21 by NaN
??? im trying to add theme support to tab controls... it works ok for property sheets though so im happy now =)
Posted on 2003-01-05 23:10:25 by BubbaFate
Im currious how your creating your dialog items.....

You say property sheets work, but Dialogs dont... (i dont have XP) but im wondering why it wouldnt??? (( This is what i ment when i said what are you up to ))

How are you creating and calling these problem window types??

Posted on 2003-01-05 23:31:33 by NaN
If I make a tab control like everyone else does on win9x/nt and then add theme support with a manifest file then I get the result indicated by the first picture below... as you can see the dialog is painted with the COLOR_BTNFACE color. To remedy this I returned a NULL_BRUSH in response to the WM_CTLCOLORDLG message thereby making my dialog transparent. BUT after I did that all the controls on that dialog box also had the COLOR_BTNFACE color as you can see by the second picture below. At this point I just smirked and thought to myself "well thats easy to fix" and proceeded to go and return a NULL_BRUSH in response to the WM_CTLCOLORSTATIC message. Thats when the real trouble began as you can see from my first post. I never did figure out a way to make just a regular tab control in your resource file work correctly with XP's visual themes... BUT if you use the PropertySheet api to create a property sheet then Windows handles all drawing (transparencies, textures, painting, whatever) and it handles it correctly. At first I thought 'ohno' because property sheets add all this junk to your window that you might not want to have, but all of that is easily correctable with SetWindowLong, ShowWindow, and SetWindowPos =)
Posted on 2003-01-06 00:04:21 by BubbaFate
This is quite old thread, but just a question. No one could find a way to correctly display Tab Controls that are added with the resource editor (in RadASM) in xp?? I get result like the pic (first one) above.

Thanks in advance.
Posted on 2003-08-16 03:38:51 by CuTedEvil
You cant do it with tab controls. This kinda makes since to me now because when your using tab controls, all the different controls are treated independently. Since all the controls are independent, Windows doesn't know which controls to draw with the tab control theme, and which ones not to draw with the tab theme. The only way to tell Windows which controls that it should be drawing all pretty is to use the property sheet api. That way Windows takes care of all drawing at the same time for each tab control.

Although I think there are theme drawing apis which you could maybe rig up to get the right effect, but the code involved would probably be complex.
Posted on 2003-08-16 06:35:30 by BubbaFate
I'm trying to use the XP themed tab control with static controls, but I can't get the NULL_BRUSH method to work.
Now compared to this thread: http://www.asmcommunity.net/board/index.php?topic=10942 I get strange results.
Using SetBkMode TRANSPARENT with or without returning the NULL_BRUSH the static has a grey background. When just returning a NULL_BRUSH the text in the static has a transparent background but the remainder of the static is grey. (The static is larger than the text within as the string length varies).
Any suggestions?
Posted on 2004-07-05 14:15:12 by adamjjackson
My mistake, further down my DlgProc I was returning true. Sorry about the extra clutter from my posts!
Posted on 2004-07-06 04:02:05 by adamjjackson