Owner draw Tab problem in Vista

Hi,

I am working on the UI application for a mouse driver.The UI has around 6-7 tabs in its tab control.We need to redraw two of those tabs based on the user’s option.To do so,We are setting the tab control style of the tab as ownerdrawfixed and on getting the WM_DRAWITEM message,We call textout() to make the text of the tab gray in color.This application works fine on XP but on Vista,the tabs lose their theme(the controls in the tab like Check boxes and buttons still retain the Vista theme).If we donot set the tab style as ownerdrawfixed,the tabs regain their theme but I would not be able to redraw the text of the tabs.
What could be going wrong with the application?
How can I get back the Vista theme to the tabs and also redraw the text of the tabs in gray?

Any inputs from you on this issue would be of great help.

Thanks in advance,

Ramya

xxxxx@wipro.com wrote:

I am working on the UI application for a mouse driver.The UI has around 6-7 tabs in its tab control.We need to redraw two of those tabs based on the user’s option.To do so,We are setting the tab control style of the tab as ownerdrawfixed and on getting the WM_DRAWITEM message,We call textout() to make the text of the tab gray in color.This application works fine on XP but on Vista,the tabs lose their theme(the controls in the tab like Check boxes and buttons still retain the Vista theme).If we donot set the tab style as ownerdrawfixed,the tabs regain their theme but I would not be able to redraw the text of the tabs.
What could be going wrong with the application?
How can I get back the Vista theme to the tabs and also redraw the text of the tabs in gray?

Why do you want the tab text gray? If you are trying to mark the tabs
as disabled, then just disable the tabs, and let the system draw them
with whatever markings are associated with disabled tabs in the current
theme. Otherwise, you’ll have to use owner draw.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hi,
Thanks for the reply.
We want the text of the disabled tabs in gray to let the user know that
those tabs cannot be accessed by him.
Could you suggest us an alternative for changing the color of the tabs?
What could be the probable reason for the tabs losing their theme after
setting the Ownerdrawfixed tab control style?

Thanks in advance,
Ramya

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Tuesday, March 27, 2007 10:15 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Owner draw Tab problem in Vista

xxxxx@wipro.com wrote:

I am working on the UI application for a mouse driver.The UI has
around 6-7 tabs in its tab control.We need to redraw two of those tabs
based on the user’s option.To do so,We are setting the tab control style
of the tab as ownerdrawfixed and on getting the WM_DRAWITEM message,We
call textout() to make the text of the tab gray in color.This
application works fine on XP but on Vista,the tabs lose their theme(the
controls in the tab like Check boxes and buttons still retain the Vista
theme).If we donot set the tab style as ownerdrawfixed,the tabs regain
their theme but I would not be able to redraw the text of the tabs.
What could be going wrong with the application?
How can I get back the Vista theme to the tabs and also redraw the
text of the tabs in gray?

Why do you want the tab text gray? If you are trying to mark the tabs
as disabled, then just disable the tabs, and let the system draw them
with whatever markings are associated with disabled tabs in the current
theme. Otherwise, you’ll have to use owner draw.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

xxxxx@wipro.com wrote:

We want the text of the disabled tabs in gray to let the user know that
those tabs cannot be accessed by him.
Could you suggest us an alternative for changing the color of the tabs?

Yes, I already told you this. There is a completely standard mechanism
for doing what you ask: set the state of the tab to TCIS_DISABLED in the
TC_ITEM structure. The system will redraw the tab in whatever the
“disabled” state is for the current theme. Usually, that means writing
the text in gray.

What could be the probable reason for the tabs losing their theme after
setting the Ownerdrawfixed tab control style?

Why would you NOT expect that? When you turn on owner draw, you are
telling the operating system “I hereby promise to do all of the drawing
for this tab.” The operating system believes you, so it stops trying to
do any of the drawing.

By the way, this question is really not appropriate for this list. I
cannot stop myself from answering technical questions, but it would be
better if you moved this to a newsgroup like
microsoft.public.win32.programmer.ui.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.