|
I use ownerdraw controls in my dialog too... which I want to look different when running under XP (e.g. make them looks more XP like). Is there an easy way to achieve this (e.g. detect XP using the selected sheme on runtime), any additional hints, handy things to know?
Thx Moak
PS: see also this thread
|
|
|
|
|
How could I do this in C#? I don't have VS.NET, but maybe there's a way simply by editing the resource files?
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchUsingWindowsXPVisualStylesWithControlsOnWindowsForms.asp
|
|
|
|
|
The Code works just fine.
But after I've had the new XP look i wondered that the flat common controls scrollbars looked like odd old scrollbars. Is it possible that the new comctl doesn't support them or about that?
Disabling them enables themed scroll bars as in every application (with or without theme support).
BTW: I didn't used MFC in my project.
--------------------------
xplo.re Administrator
http://www.xplo-re.de/
|
|
|
|
|
Just what I've been looking for. Thanks a bunch!
swinefeaster
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
It's great! in a MFC project the "insert manifest" step seems to be enough
BUT.....
I'm using multiple keyboard layouts and some non-english characters do not appear in edit boxes (in my program and in the test app too), they show up or as a box or the letter without accents and stuff. What can I do???
|
|
|
|
|
Thanks .. it is very useful. Could you please explain the following steps
1. choose "Custom", input "24" (without quotes) as resource type
Why 24 why not 26 or 34
2. Change resource ID to 1. Why?
Thanks
|
|
|
|
|
In "winuser.rh" of the latest version of Platform SDK, include the following lines:
#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
#define RT_MANIFEST 24
Is this make sense?
Alan Wen
|
|
|
|
|
Yes!
Thanks Alan...
-Mona
|
|
|
|
|
don't support chinese (GB2312)
|
|
|
|
|
If I try this on a standard MFC application, the toolbar doesn't seem to be repainted properly. Anyone know how to solve this?
|
|
|
|
|
I am having the same problems... could someone please help us out?
|
|
|
|
|
I found out that if I have no borders and no gripper on the toolbar it looks ok.
|
|
|
|
|
Well, no toolbar will work too. hehe, but I want a gripper and border... there must be a way to fix this.
|
|
|
|
|
Use Create instead of CreateEx when creating the toolbar. This worked for me.
|
|
|
|
|
Create() just calls CreateEx() with 0 for dwCtrlStyle and zero borders. Did you mean calling Create() works, in other words it works if you don't have a flat toolbar with a gripper, or did you mean that you can create the same toolbar (with flat appearance and gripper) using Create()?
I've search at microsoft.com, on usenet, and nobody else mentions the trouble with toolbars or the solution. Is everybody just waiting for SP6 or VC++ 7 to fix the problem?
|
|
|
|
|
I had the same issue. They I changed the method to using the manifest file, rather than including the resource, and it works much nicer.
|
|
|
|
|
I dunno if you guys have figured this out... but I found a way to fix this. Use the TBSTYLE_FLAT | TBSTYLE_TRANSPARENT only if themes are not being used. See http://www.codeproject.com/useritems/themewrapper.asp for more info.
cheers,
swinefeaster
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
TBSTYLE_FLAT | TBSTYLE_TRANSPARENT helped but I still wanted the border and left had docking grip thing.
My Solution, in addition to the above:
Subclass CToolBar and add a message handler for ON_WM_ERASEBKGND in which you paint a filled rectangle with the system colour COLOR_3DFACE from 0,0 to the height and width of the toolbar.
This works for me but causes flicker when resizing the window, better than the mess before though.
Matt
|
|
|
|
|
Okay, now this works. If you do this you don't need the omit the TBSTYLE_FLAT flag if on XP with themes on. Just fill the toolbar with the COLOR_3DFACE color and all is well.
True, there is some flicker when you resize, but it's not much worse than what I see from the status bar and dialog bars, and Microsoft's menus and toolbars (in Visual Studio) flicker too.
|
|
|
|
|
For me, this problem occured when I had the style TBSTYLE_FLAT set. So what I did was NOT setting this style if COMCTL32.DLL version was 6 or above... I have only tested this on XP though.
/Fredrik
|
|
|
|
|
This is exactly what I did. I thought it worked okay, but then I set Windows XP to use the classic Windows look instead of the new theme, and then saw that the toolbar didn't get painted correctly. So, this solution doens't work either.
Believe it or not, this problem still exists in the brand new Visual Studio .NET that I just got. Build a generic MFC app using the app wizard and the gripper is painted in the wrong color. Amazing. I'm what they call a Microsoft apologist, but now I'm seriously upset at this. I can't ship my app if the toolbar looks like this. Idiots.
|
|
|
|
|
If you want a toolbar with gripper and borders and you want it to repaint correctly on Windows XP with either one of the new visual styles or with the classic Windows look, do this:
Instead of
m_wndToolBar.CreateEx(...);
write
m_wndToolBar.SetBorders(1, 1, 1, 1);
m_wndToolBar.Create(...);
m_wndToolBar.ModifyStyle(0, TBSTYLE_FLAT);
For me this solves all the repaint problems I was having and there's no need to use any of the other tricks discussed above (which don't work in all cases anyway).
|
|
|
|
|
Just tried this with both VS 6 and VS .NET and it works in both cases. Amazing. My toolbar problems are solved.
|
|
|
|
|
can any any body tell me the system metric of the highlight box around the tool bar icon (and text) is.. I want to make my panel auto size to correctly work depending on the theme as some themes seem to put a wider boarder around it..
cheers
Chris
|
|
|
|