One thing depends on another. When I worked on my own UxTheme implementation, I found that comctl32 likes to send 0 instead of properly arguments. It angered me.
Do you mean the way comctl32 uses uxtheme API currently is wrong? How did you find out it's not using it right way, with proper arguments?
I didn't write it uses UxTheme API wrong. Let's say it doesn't use all features. Thus I can't unfold to the full.
For example, uxtheme provides a great function named DrawThemeText. My first implementation used Pango because it's the native text engine for all GTK- applications. Unfortunately I had to refuse this idea because only a couple of controls used it. Thus the result was very ugly. But the problem is not limited to the text layout engine. Even if you want to draw some text yourself, you should probably get the right color and the right font from GetThemeColor and GetThemeFont respectively first. At the worst way ask what GetSysColor thinks. But sometimes comctl32 believes the plain black color should please everyone. This is crazy, guys!
Back to the words about using the improper arguments. There is a theme class named LISTBOX. It defines 4 different parts depends on the scrollbar position. This parts have ids from 1 to 4. If you look at the file comctl32/theme_listbox.c you see it always sends the undocumented value 0.
Take a look at the theme class EDIT. One part exists for the background (EP_BACKGROUND) and 4 parts were generously provided by Microsoft for the borders around. Let's open the comctl32/theme_edit.c source file. Firstly it uses only EP_EDITTEXT (probably created for the text inside). Secondly it doesn't ask UxTheme to draw the background. Even if you draw the background as a part of EP_EDITTEXT (as I did), it will be overlapped. This makes problems for such themes as Ambiance (the default Ubuntu theme).
There is also a cool theme class named LISTVIEW. It provides a lot of parts for such things as list items (LVP_LISTITEM) which even support 6 states (normal, hot, selected, etc.) Guess how many parts comctl32 uses? Right, only one (the undocumented 0 again). Although a lot of GTK themes like to use gradients for list items. Even the Windows Aero theme does it. Therefore I don't believe Windows does it in the same way (just according to the things I see on the screen).
P.S. I noticed there was a typo in my previous mails. Of course I wanted to write "flickering" instead of "flipping" saying about the double buffering advantages. It looks like you understood me right, just to be sure.