Vista Style Builder

   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: UIFILE editing breaks classic theme  (Read 15308 times)
RLA
Beginner
*
Posts: 10


View Profile
« on: July 22, 2013, 09:52:41 pm »

Hi.

I have a visual impairment which, among, other things, means that I am unable to see anything other than a fuzzy mess when looking at ClearType-smoothed fonts (and no, it has nothing to do with my setup, as everybody says that the fonts on my computer are clear and crisp). This is why I delayed the upgrade to Windows 7 from XP until now, and I am now trying to make Windows 7 usable for me by putting non-smooted Tahoma all over the place in the XP fashion.

All is going fine so far. I installed the NoSegoe registry hack, downloaded an aero theme and changed every font to Tahoma, 8. Everything is OK.

But, besides not having the best of the sights, I am also a picky person, and I'm seeing some fonts that should be 8 points being rendered at 9 points. I have found that most of the 9 pt fonts in programs and Windows dialogs are hardcoded into the EXE, DLL or MUI files. I'm OK with this, as it is just a matter of time going through the files and replacing "FONT 9, "Segoe UI"" for "FONT 8, "Tahoma"" or "FONT 8, "Segoe UI"" (which I'll see as Tahoma because of the font remapping in the aforementioned NoSegoe registry hack).

There are, however, some 9pt sizes that aren't hardcoded, because they render at 9pt with aero, but at 8pt with classic theme. Maybe there is some setting (which will be nice to know) which controls the "Aero default font size = 9" and "Classic default font size = 8" policy, but the thing is that I'm trying to convert some of these non-hardcoded and non-themed 9 pt sizes to 8 pt.

One of the most prominent of them is the UIGroupHeader font, which can be seen in, AFAIK, the SearchView in StartMenu and the group headers in Windows Explorer. Here it is:



Every font on my theme is 8pt, and this font is shown as 8pt in the classic theme. By searching this forum, I have learned that I can map this font to a font in my theme. It's a funny thing that this font picks every setting but the size from the active theme, but if you want to set its size you have to explicitly map it to the font it is already mapped to.

Anyway, according to this thread that mapping can be accomplished by editing the 40960 UIFILE in System32\ExplorerFrame.dll. To be exact, it is done by changing

Code: xml

to

Code: xml

Apparently, this tells ExplorerFrame.dll that it should draw those headers using the font that is set by theme as HEADING1FONT:FONT at the location that we see in WSB under List, Menus and Tabs > ListView > GroupHeader, and it works wonderfully, as I have changed that font in the theme and immediately seen the effects in the Start Menu and Windows Explorer.

But this edition happens also to break the Classic theme. With that ExplorerFrame.dll, when Windows is set to Classic theme, it won't open any window that includes that style (and that includes every window in Windows Explorer), and the Start Menu Search View looks as broken as this:



My question is: how can I avoid this? How can I set the font I want from the aero theme while leaving the Classic theme untouched?

Besides, does that universal "aero=9", "classic = 8" default font size setting exist? Can it be included in themes?

Best regards.
« Last Edit: July 23, 2013, 03:06:20 pm by RLA » Logged
Panda X
Administrator
Dedicated Helper
*****
Posts: 1627



View Profile
« Reply #1 on: July 22, 2013, 10:18:25 pm »

To leave classic untouched you have to use themeable() in the UIFile.

So font="gtf(Listview, 6, 0, 807)" would become font="themeable(gtf(ListView, 6, 0, 807), menufont)"

Or at least that's how it should work, I can find an example of themeable() being used with gtf() in any dll file.
Logged
RLA
Beginner
*
Posts: 10


View Profile
« Reply #2 on: July 22, 2013, 10:45:21 pm »

To leave classic untouched you have to use themeable() in the UIFile.

So font="gtf(Listview, 6, 0, 807)" would become font="themeable(gtf(ListView, 6, 0, 807), menufont)"

Or at least that's how it should work, I can find an example of themeable() being used with gtf() in any dll file.

Hi, Panda X.

Thanks.

This does indeed make the menu show again, but the font size is enormous:



I tried

Code: xml
fontsize="8pt"

at the end of the string and Windows just ignored it.

However, inspired by you, this:

Code: xml
font="themeable(gtf(Listview, 6, 0, 807), 'menufont;100%')"

works just fine:



Thank you very much.

I will now begin the hunt for more oversized fonts. I'll need some things:

1) How can I get the style from the theme being applied (to remap to it explicitly again in the UIFILE just like in this case) in a particular part of a window? Is there a window info tool or should I just search the maps section in this forum?

2) How can I get the strings like "(Listview, 6, 0, 807)". I can get the IDs, states and parts, but how can I get the class? It seems overly complicated to me, because there are more than a few "ListView" (for example) sections in the theme.

3) Can anyone point me to a Classic themes list of colors and fonts to use with Themeable()?
« Last Edit: July 23, 2013, 03:07:00 pm by RLA » Logged
3am
Beta Tester
Dedicated Helper
*
Posts: 2182



View Profile
« Reply #3 on: July 23, 2013, 12:29:06 pm »

1) Use the maps to find out msstyles locations for windows etc
2) Use the Status Bar for Class, Part and State information
3) You could apply the Classic theme and then open Personalization > Windows Color and Appearance > Advanced Appearance Settings to find default Classic colors etc

If you don't have a Status Bar then either download the Beta where it's activated by default or make a new shortcut on your desktop with the address in a form like "C:\Program Files (x86)\AveApps\Windows Style Builder\VistaStyleBuilder.exe" -debug, put the shortcut at the address and use this to open WSB. You need those quotes and then a space and then -debug. If you have a 32 bit OS then Program Files (x86) will just be Program Files

Once you get the Status Bar you'll find the info in this form:

For example: Explorer & Shell > Explorer > Items View > ListView you'll see

"Itemsview::Listview (#61) inherits from Explorer::Listview (#60), part #0, state #0"

which you convert to the syntax of (Itemsview::Listview, 0, 0, Property ID you have to look up)

Itemsview::Listview is the Class

« Last Edit: July 23, 2013, 12:40:08 pm by 3am » Logged
RLA
Beginner
*
Posts: 10


View Profile
« Reply #4 on: July 23, 2013, 03:01:45 pm »

Hi, 3am.

1) Use the maps to find out msstyles locations for windows etc

Do you mean the maps section in this forum?

2) Use the Status Bar for Class, Part and State information

If you don't have a Status Bar then either download the Beta where it's activated by default or make a new shortcut on your desktop with the address in a form like "C:\Program Files (x86)\AveApps\Windows Style Builder\VistaStyleBuilder.exe" -debug, put the shortcut at the address and use this to open WSB. You need those quotes and then a space and then -debug. If you have a 32 bit OS then Program Files (x86) will just be Program Files

Once you get the Status Bar you'll find the info in this form:

For example: Explorer & Shell > Explorer > Items View > ListView you'll see

"Itemsview::Listview (#61) inherits from Explorer::Listview (#60), part #0, state #0"

which you convert to the syntax of (Itemsview::Listview, 0, 0, Property ID you have to look up)

Itemsview::Listview is the Class

Excellent info. This should be sticky in this forum. Thank you very much.

3) You could apply the Classic theme and then open Personalization > Windows Color and Appearance > Advanced Appearance Settings to find default Classic colors etc

I think that this won't give the names of the colors and fonts as it should be used with themeable(), but it helps a lot to figure out which color and font is each string pointing to. I found such a list by looking into the classic styles *.theme files. The list of fonts is nicely listed there:

Code:
[Metrics]
CaptionFont=@themeui.dll,-2037
SmCaptionFont=@themeui.dll,-2038
MenuFont=@themeui.dll,-2039
StatusFont=@themeui.dll,-2040
MessageFont=@themeui.dll,-2041
IconFont=@themeui.dll,-2042

The colors and sizes are given through a reference to themeui.dll. I've don't digged there that much, but Google has found what looks like a list of colors, fonts and sizes suitable for themeable() use. They are in various places of the Windows registry:

Code:
[HKEY_CURRENT_USER\Control Panel\Desktop\Colors]
"ActiveBorder"="212 208 200"
"ActiveTitle"="10 36 106"
"AppWorkSpace"="128 128 128"
"ButtonAlternateFace"="181 181 181"
"ButtonDkShadow"="64 64 64"
"ButtonFace"="212 208 200"
"ButtonHiLight"="255 255 255"
"ButtonLight"="212 208 200"
"ButtonShadow"="128 128 128"
"ButtonText"="0 0 0"
"GradientActiveTitle"="166 202 240"
"GradientInactiveTitle"="192 192 192"
"GrayText"="128 128 128"
"Hilight"="10 36 106"
"HilightText"="255 255 255"
"HotTrackingColor"="0 0 128"
"InactiveBorder"="212 208 200"
"InactiveTitle"="128 128 128"
"InactiveTitleText"="212 208 200"
"InfoText"="0 0 0"
"InfoWindow"="255 255 255"
"Menu"="212 208 200"
"MenuText"="0 0 0"
"Scrollbar"="212 208 200"
"TitleText"="255 255 255"
"Window"="255 255 255"
"WindowFrame"="0 0 0"
"WindowText"="0 0 0"

[HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics]
"BorderWidth"="-15"
"CaptionFont"=hex:f5,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,bc,02,00,00,\
  00,00,00,01,00,00,04,00,54,00,61,00,68,00,6f,00,6d,00,61,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"CaptionHeight"="-315"
"CaptionWidth"="-315"
"IconFont"=hex:f5,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,00,\
  00,00,01,00,00,00,00,54,00,61,00,68,00,6f,00,6d,00,61,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"IconTitleWrap"="1"
"MenuFont"=hex:f5,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,00,\
  00,00,01,00,00,04,00,54,00,61,00,68,00,6f,00,6d,00,61,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"MenuHeight"="-285"
"MenuWidth"="-285"
"MessageFont"=hex:f5,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,\
  00,00,00,01,00,00,04,00,54,00,61,00,68,00,6f,00,6d,00,61,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"ScrollHeight"="-255"
"ScrollWidth"="-255"
"SmCaptionFont"=hex:f5,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,bc,02,00,\
  00,00,00,00,01,00,00,04,00,54,00,61,00,68,00,6f,00,6d,00,61,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"SmCaptionHeight"="-255"
"SmCaptionWidth"="-255"
"StatusFont"=hex:f5,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,\
  00,00,00,01,00,00,04,00,54,00,61,00,68,00,6f,00,6d,00,61,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"Shell Icon Size"="32"
"AppliedDPI"=dword:00000060
"PaddedBorderWidth"="-60"
"IconSpacing"="-960"
"IconVerticalSpacing"="-960"
"MinAnimate"="0"

I've seen "windowtext" and "menufont" being used a lot in the XML UIFILES, so probably most of these values will work there just like them.




Logged
3am
Beta Tester
Dedicated Helper
*
Posts: 2182



View Profile
« Reply #5 on: July 23, 2013, 03:44:15 pm »

1) Yeah use the maps in the map section on the forum. They make life a lot easier Smiley

2) I highly recommend you download Resource Spy here   http://vistastylebuilder.com/forum/index.php?topic=1290.0. Once you make a change in a copy of a system file it allows you to see what would happen if you actually changed the system file. Saves you a lot of crashes. Also in the tree you can see what system files are opened wherever you are and what specific UIFILES, bitmaps etc are opened in those files. Saves a lot of time and trouble. Works only in 64 bit.

3) There are fonts you cannot change no matter what you do
« Last Edit: July 23, 2013, 03:47:50 pm by 3am » Logged
RLA
Beginner
*
Posts: 10


View Profile
« Reply #6 on: July 23, 2013, 04:13:34 pm »

1) Yeah use the maps in the map section on the forum. They make life a lot easier Smiley

Yes. It is really comprehensive. Every tiny bit of Windows is in there.

2) I highly recommend you download Resource Spy here   http://vistastylebuilder.com/forum/index.php?topic=1290.0. Once you make a change in a copy of a system file it allows you to see what would happen if you actually changed the system file. Saves you a lot of crashes. Also in the tree you can see what system files are opened wherever you are and what specific UIFILES, bitmaps etc are opened in those files. Saves a lot of time and trouble. Works only in 64 bit.

This sounds amazing, especially the ability to show "what system files are opened wherever you are and what specific UIFILES, bitmaps etc are opened in those files". I have installed x86 because I have only 4 gigs of RAM. I'm thinking about installing the 64 bit Windows just because of this. I seem to understand that in 64 bit systems every system file is duplicated. Does this mean that every edit in system files (shell32.dll.mui, for example) should be performed over both the 32 and 64 bit system files? Might Resource Spy work if I install x64 in a virtual machine?

3) There are fonts you cannot change no matter what you do

Yes. I've noticed this. The text that contains the description of the services in services.msc, for example, seems unchangeable. Also, I've tried very hard, but it seems that the caption font under Aero can't be uncleartyped because of some obscure DWM stuff.

But it still intrigues me how does Windows set certain unthemed and unhardcoded fonts to 8 points when then Classic theme is enabled while setting them to 9 points when Aero is enabled. I've disasembled some dlls and found a number of suspicious ret 09 and push 09 opcodes, but I don't have the assembly knowledge nor the guts required to blindly edit those 09 to 08s.
Logged
Panda X
Administrator
Dedicated Helper
*****
Posts: 1627



View Profile
« Reply #7 on: July 23, 2013, 04:42:11 pm »

This sounds amazing, especially the ability to show "what system files are opened wherever you are and what specific UIFILES, bitmaps etc are opened in those files". I have installed x86 because I have only 4 gigs of RAM. I'm thinking about installing the 64 bit Windows just because of this. I seem to understand that in 64 bit systems every system file is duplicated. Does this mean that every edit in system files (shell32.dll.mui, for example) should be performed over both the 32 and 64 bit system files? Might Resource Spy work if I install x64 in a virtual machine?

Not all system files are duplicated, most are however. Open File and Save File dialogs still use the 32-bit shell so if you're doing UIFile modification then it'd be best to modify both. Yes ResSpy will work on a virtual machine just fine Smiley
Logged
3am
Beta Tester
Dedicated Helper
*
Posts: 2182



View Profile
« Reply #8 on: July 23, 2013, 05:05:14 pm »

Yes. It is really comprehensive. Every tiny bit of Windows is in there.

This sounds amazing, especially the ability to show "what system files are opened wherever you are and what specific UIFILES, bitmaps etc are opened in those files". I have installed x86 because I have only 4 gigs of RAM. I'm thinking about installing the 64 bit Windows just because of this. I seem to understand that in 64 bit systems every system file is duplicated. Does this mean that every edit in system files (shell32.dll.mui, for example) should be performed over both the 32 and 64 bit system files? Might Resource Spy work if I install x64 in a virtual machine?

Yes. I've noticed this. The text that contains the description of the services in services.msc, for example, seems unchangeable. Also, I've tried very hard, but it seems that the caption font under Aero can't be uncleartyped because of some obscure DWM stuff.

But it still intrigues me how does Windows set certain unthemed and unhardcoded fonts to 8 points when then Classic theme is enabled while setting them to 9 points when Aero is enabled. I've disasembled some dlls and found a number of suspicious ret 09 and push 09 opcodes, but I don't have the assembly knowledge nor the guts required to blindly edit those 09 to 08s.


Yeah I have the same problem with the caption font. Never could fix it. Likewise the font in the description of services in services.msc Huh?

I have no idea why the font size changes in Aero and Classic.

Also be careful in changing font types. Some fonts are also used for glyphs and structures (and I don't mean just Marlett). I've lost various structures and functionalities messing with fonts. Like here for instance http://vistastylebuilder.com/forum/index.php?topic=1539.0
« Last Edit: July 23, 2013, 05:08:11 pm by 3am » Logged
RLA
Beginner
*
Posts: 10


View Profile
« Reply #9 on: July 23, 2013, 06:58:37 pm »

Also be careful in changing font types. Some fonts are also used for glyphs and structures (and I don't mean just Marlett). I've lost various structures and functionalities messing with fonts. Like here for instance http://vistastylebuilder.com/forum/index.php?topic=1539.0

Good to know. Actually, I have mapped both MS Shell Dlg and MS Shell Dlg 2 to Tahoma. No ill effects so far, but I'll keep an eye on this.
Logged
RLA
Beginner
*
Posts: 10


View Profile
« Reply #10 on: August 08, 2013, 04:31:07 am »

Hi again.

I've ditched my Windows 7 x86 installation and replaced it with Windows 7 x64. I'm carrying my custom theme from there, which is nothing else than a theme downloaded from devianart with a few changes here and there. This theme is claimed to be 64 bit aware, if it matters.

As incredible as it sounds, I am now facing the opposite problem I had when I wrote the OP.

Back then, I modified ExplorerFrame.dll to change the uigroupheader font. The problem was that

Code:
<UIGroupHeader background="argb(0,0,0,0)" contentalign="topleft" font="gtf(Listview, 6, 0, 807)"/>

was setting the font nicely under aero, but broke the classic theme. This was fixed using the themeable() function this way:

Code:
<UIGroupHeader background="argb(0,0,0,0)" contentalign="topleft" font="themeable(gtf(Listview, 6, 0, 807), 'menufont;100%')"/>

which worked fine in both aero and classic themes.

Now, in x64, I've performed such edit to both ExplorerFrame.dll files in System32 and SysWOW64, and the result is that the classic theme gets the font just right (shows at 8 pt instead of the default 9 pt), but I can see no changes under aero.

It seems that the gtf(Listview, 6, 0, 807) bit in ExplorerFrame.dll is not working, because editing such font in WSB (HEADING1FONT:FONT under Lists, Menus & Tabs > ListView > GroupHeader) has no effect at all. It looks like Windows is just ignoring it.

Any ideas?
« Last Edit: August 08, 2013, 11:41:37 am by RLA » Logged
3am
Beta Tester
Dedicated Helper
*
Posts: 2182



View Profile
« Reply #11 on: August 08, 2013, 01:35:17 pm »

What happens if you don't do the changes in the SysWOW64 ExplorerFrame?

I could be wrong but I think you only have to do the changes in System32
Logged
RLA
Beginner
*
Posts: 10


View Profile
« Reply #12 on: August 08, 2013, 03:03:42 pm »

What happens if you don't do the changes in the SysWOW64 ExplorerFrame?

Nothing. I sfc'ed the file and logged off. Nothing changed.

I can't understand why the edit has no effect.
Logged
RLA
Beginner
*
Posts: 10


View Profile
« Reply #13 on: August 08, 2013, 06:46:26 pm »

Ok, I'm just thinking out loud.

I've just had to create a symlink in SYSWOW64 to a dll in System32 to be able to launch XP Mode programs from the launcher I use (which is PowerPro). It looks like every 32 bit program is automatically redirected to SysWOW64 when it asks for System32.

As I am using a 32 bit editor, it is possible that I might be always editing SysWOW64\ExplorerFrame.dll even when I explicitly open System32\ExplorerFrame.dll in my resource editor? Does redirection work that way?

Which is the path to go in this case? Is there a 64 bit resource editor? Will be enough to just copy the file outside System32, edit it and copy it back to its place?

I'm just saying nonsense?
Logged
Panda X
Administrator
Dedicated Helper
*****
Posts: 1627



View Profile
« Reply #14 on: August 08, 2013, 07:08:03 pm »

Yes it does work that way.

If you use any 32-bit program loading/opening files from System32 always get redirected to SysWOW64. You can open the files in System32 by going to C:\Windows\SysNative instead to avoid the redirect.
Logged
RLA
Beginner
*
Posts: 10


View Profile
« Reply #15 on: August 08, 2013, 07:32:40 pm »

Yes it does work that way.

If you use any 32-bit program loading/opening files from System32 always get redirected to SysWOW64. You can open the files in System32 by going to C:\Windows\SysNative instead to avoid the redirect.

Flawless victory!

Just for the record, I've just copied the file outside of System32 (with the 64 bit Explorer.exe), edited it, renamed ExplorerFrame.dll in System32 and copied the edited file in its place.

The SysNative thing is good to know. It would have saved me a handful of hours if I had be aware of it.

Best regards.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.12 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!