Posts Tagged ‘DirectUI’

Easy to use multishell shellstyle.

Sunday, April 5th, 2009

Back in Vista Betas the DirectUI XML had Template ID’s for certain types of folder layouts (Generic, Documents, Photos and Videos, and Music) and they were used to specify the specific color gradients.

001 

Windows Vista Beta showing the details pane gradient for the Generic files layout.

This was made possible in Vista by Michael at http://www.aeroxp.org/ by re-adding the Template ID’s back to their original location in the DirectUI XML file. This was good enough for most people but I have always wanted to have it in the MSStyles file. If you recall I made a blog post on how to link properties from DirectUI to the MSStyles ( http://blog.vistastylebuilder.com/?p=5 ). A more thorough explanation can be found at http://vistastylebuilder.com/forum/index.php?topic=215.0. I had tried adding the shell images to the MSStyles before and it worked but didn’t look good. It scaled horrible and didn’t look as it should.

integratedshellbackgroundoriginal

Original attempt at having the shell images in the MSStyles file.

As you can see it doesn’t look the same. It’s faded and improperly stretched. I say that was a user error on my end. It wasn’t until today I decided to have another stab at it and hit the jackpot. Everything worked as it should have.

integratedshellbackground

Shellstyle images for the Details Pane added to the MSStyles and fully tested!

That wasn’t so hard. Now to do it in Vista.

You can go ahead and grab the shellstyle for Windows 7 Build 7068 here: http://media.longhornfusion.net/vsbblog/downloads/shellstyle.dll

The properties and images are located in Explorer & Shell > Shell > PreviewPaneControl > Template:Edit > Background. (CommonItemsDialog:Edit doesn’t have it.)

You need this StyleHack: http://media.longhornfusion.net/vsbblog/downloads/ShellStyle.stylehack

 

themeable() What it does and how you can use it.

Monday, February 23rd, 2009

Continuing the DirectUI XML we come across a fiew road blocks. Mainly because it’s not documented. However with extensive testing you’re sure to find out a lot. The biggest concern over Ave and I’s mind is the themeable() function. We knew it take two parameters, but we didn’t know what the second one was for.

Last night we discussed it and couldn’t figure out what it was used for. So time goes on, and I stay up late to continue finding what it’s for. It wasn’t until this afternoon that we cracked it. After all this time we found out it was for the Classic theme. Doesn’t make sence at first but I can explain.

This example will be used for the rest of the blog entry: themeable(x, y)

If you look back at my recent post I made a mod for ExplorerFrame.dll to allow custom colors on hover, compressed, etc. When I had it set it just a theme property (x) any theme applied that didn’t have those properties caused Windows Explorer to not work. My hacky solution to that was to just create a StyleHack and add those properties to every theme including the default Aero. It became hard to do that when I went to test a theme and it was in use so it applied Aero (which at the time didn’t have the properties) so I was stuck. The only way I could get out was to go into the registry, change the applied theme, log out and then log back in. Not the most convenient thing right? Well luckily today’s research fixed that.

If you’ve ever looked closely at a property that specifies themeable() you’ll probably notice that “x” usually (sometimes it has both hard”coded” values) has a property that reads from the theme while “y” is something that’s hard”coded”. (eg. window, argb(0,0,0,0), etc). If “x” isn’t available for whatever reason then “y” will be used. Another example I’m about to show you is from my ExplorerFrame mod. In this screen below I have the old ExplorerFrame mod (left) and the default ExplorerFrame 40690.xml (right).

http://www.tehupload.com/uploads/486360dbcab3329old.png

Look at lines 1203 and 1213 of the default (right). You can see it specified a color. One being pre-defined, the other being specific. Now look at those lines on the modified file (left). As you can see it reads from the MSStyles. Now what happens when the MSStyles (if one is applied) doesn’t have that property? Explorer doesn’t know what to do so it just stops working. Now look at this next image.

http://www.tehupload.com/uploads/552260dbcab3322new.png

On the modified document (left) it now has themeable(x, y). Now when an MSStyles file (if one is applied) is missing the property or if you’re using classic it will default to “y”.

Now that that’s cleared up you’re probably still wondering “If it’s used for classic then why is it in the theme’s shellstyle.dll”. Good question. Now here’s an answer. Sometimes a window will force the classic style. (Ex. Open CMD with Basic applied in Vista.) You can also run CMD as an Administrator and run “net stop themes” without the quotations and it’ll show a classic like UI which gives a better viewing of what it does. When either of these two happen you’ll notice that the Classic interface is almost pure white with a light blue titlebar (instead of the default darker blue) and a horrible-looking border padding. This is where those “y” values in a theme’s shellstyle.dll are used.

If you have any thoughts or questions about the themeable() function the feel free to leave a comment.

-Panda

Hover, Selected, Compressed, and Encrypted colors in VSB

Saturday, February 21st, 2009

There are a lot of things I don’t agree with in the theming system in Windows. One being several different resources being housed into multiple DLL files along with the MSStyles file. Luckily most of these things are in XML (DirectUI XML to be precise) so we can read it and edit it.

What I’ve been doing lately is having properties from these XML files within the DLL files read from the MSStyles file to provide a central way to customize the look and feel of the UI. Microsoft is doing this as well however I doubt they’re going to get all of it.

One of the most requested “features” in theming would be to change the Explorer’s ListView Hover, Selected, Compressed, and Encrypted colors. It’s been on my to-do list all week and I decided I’d wait until the weekend to look into it. I already tested the shellstyle.dll for these colors last week. It was a no-go. So I dug into ExplorerFrame.dll and took a look at the XML files. I found the colors and sadly they were hardcoded so I had to do some theme research. In doing so I added properties to Windows 7 > Explorer & Shell > Explorer > List View > ListItem. Those properties are HEADING1TEXTCOLOR:COLOR which is for the compressed file color, HEADING2TEXTCOLOR:COLOR which is for the encrypted file color. I defaulted them to their original colors. I also added TEXTCOLOR:COLOR to Windows 7 > Explorer & Shell > Explorer > List View > ListItem > Hot to specify the hover text color of an item in explorer. I also added TEXTCOLOR:COLOR to Windows 7 > Explorer & Shell > Explorer > List View > ListItem > Selected to specify the selected text color of an item in explorer. Here’s a video of the testing of it: http://media.longhornfusion.net/Win7/Research/Win7_ExplorerFrame-Modified.swf

Note: So far I’ve only looked into doing this in Windows 7 as it’s my default OS. I’ll look into Vista tomorrow.

-Panda X