Posted: 2015-04-24, 15:31 UTC
TWinKey can not only colorize tabs, but assign an icon to each. And there is also another solution
Hmm, do you happen to know the message? Couldn't find anything.Highlighting is done via tab control message
There is no owner drawing of tab headers. I would have to create my own tab control with owner drawing everything calling the theme commands myself.However I think tabs may be colored using custom erasing of background (i.e. we should be able to use any desired background color for tab header rectangles when Windows needs to redraw the control).
Actually there is but it doesn't cover the whole tab header area just the content area of the header. Just try and judge if this is enough for you. For me it seems TWinKey also uses only the content area for drawing.There is no owner drawing of tab headers.
I got it from mentioned PowerPro script, the message is TCM_HIGHLIGHTITEM (but it doesn't allow specifying highlight color, it depends on Windows theme).ghisler(Author) wrote:Hmm, do you happen to know the message? Couldn't find anything.
But I still think that background erasing for entire tab control is still done using WM_ERASEBKGND, so overriding it should allow coloring tab headers as we like: you fill tab entire control with default background color but tab headers with another ones (there is a message TCM_GETITEMRECT that returns rectangles for tab headers).ghisler(Author) wrote:There is no owner drawing of tab headers. I would have to create my own tab control with owner drawing everything calling the theme commands myself.
It may reguire drawing entire tabs by hands.Lefteous wrote:Create the tab using the TCS_OWNERDRAWFIXED style. Then draw in the normal WM_DRAWITEM handler in the parent window.
Yes you have to draw the entire tab header client area. Or did you mean something else? I have tried it and that's the way it works. Do you think it's too difficult to draw a filled rectangle and a text in this area?It may reguire drawing entire tabs by hands.
I pretty think it is difficult to draw 3D-looked tab header borders to make them look just like in Windows theme.Lefteous wrote:Yes you have to draw the entire tab header client area. Or did you mean something else? I have tried it and that's the way it works. Do you think it's too difficult to draw a filled rectangle and a text in this area?
Where can I see this picture?Lefteous wrote:Here is a picture for illustration. On top you see TWinKey in action and below you see the tab client area in red.
It's really just the client area - no necessity to draw the border.I pretty think it is difficult to draw 3D-looked tab header borders to make them look just like in Windows theme.
Sorry here it is. I have added a third image section which illustrates how icons instead of owner drawn client area could look like, so:Where can I see this picture?
While I personally do not use TWinKey, I have to admit, the gradient coloring is beautiful.Lefteous wrote:1. TWinkey
2. Client area in tab header which can be drawn when using custom drawing in tab control (red rectangle)
3. Icon in tab header (basic feature of Windows tab control, no custom drawing required)
[img]http://fs2.directupload.net/images/150427/dxgpz2n8.png[/img]
Looks good.2. Client area in tab header which can be drawn when using custom drawing in tab control (red rectangle)
I have to admit, the gradient coloring is beautiful.
The tab header width is defined by the elements in the TCITEM structure in the TCM_INSERTITEM message. So you add the tab header including label (or even an icon) as usual and then start drawing in WM_DRAWITEM. You can of course do some tricking in TCM_INSERTITEM by using a very long string to get some space.I guess I should use ownerdrawvariable to adjust to the dir name length?