236 lines
7.4 KiB
Plaintext
236 lines
7.4 KiB
Plaintext
Theme Authoring Kit - 7/26/00
|
|
-----------------------------
|
|
|
|
The Theme Authoring Kit (TAK) is an informal (internal use only) collection
|
|
of tools to help theme authors build new "visual styles" for Whistler.
|
|
|
|
TAK consists of the following:
|
|
|
|
1. themesel.exe (theme testing program - see below)
|
|
|
|
2. packthem.exe (packages theme files into a .mstheme DLL)
|
|
|
|
3. tools needed for running packtheme.exe:
|
|
|
|
- rc.exe (resource compiler)
|
|
- link.exe (linker; used to build dll)
|
|
- rcdll.exe (used by rc.exe)
|
|
- cvtres.exe (used by link.exe)
|
|
- mspdb60.dll (used by link.exe)
|
|
|
|
4. Sample theme Directories:
|
|
|
|
- Business
|
|
- BusSolid
|
|
- BusDev
|
|
|
|
5. Informal documentation:
|
|
|
|
- schema.txt (explains format/use of "TmSchema.h" file)
|
|
- themes.txt (explains format/use of .ini files for themes)
|
|
- tak.txt (this file)
|
|
- skeming.ppt (a powerpoint intro to themes)
|
|
|
|
6. misc files:
|
|
|
|
- TmSchema.h (schema file)
|
|
- SchemaDef.h (schema helper file)
|
|
- uxtheme.h (public api for theme-aware controls)
|
|
- uxthemep.h (internal-only api for theme selection UI)
|
|
|
|
|
|
Manually Switching Themes:
|
|
--------------------------
|
|
|
|
Until the real theme switching UI is ready, you can turn themes ON/OFF
|
|
(and switch themes) by manually editing the registry:
|
|
|
|
To turn the business "visual style" ON:
|
|
|
|
a. shut down explorer (Start | Shut down | hold CTRL+ALT+Shift and click on the cancel button)
|
|
|
|
b. run: regedit
|
|
|
|
c. navigate to: HKEY_CURRENT_USER\software\microsoft\windows\currentversion
|
|
|
|
d. add KEY: ThemeManager
|
|
|
|
e. add string value to ThemeManager key:
|
|
|
|
string: ThemeActive
|
|
value: 1
|
|
|
|
f. add string value to ThemeManager key:
|
|
|
|
string: DllName
|
|
value: %windir%\resources\0409\themes\business\business.mstheme
|
|
|
|
g. close "regedit"
|
|
|
|
h. run: explorer
|
|
|
|
i. verfiy that taskbar has a new start button, smaller text, etc.
|
|
|
|
The file "themeon.reg" automates the above steps. You can run in using "start themeon.reg"
|
|
|
|
|
|
To turn the business "visual style" OFF:
|
|
|
|
a. shut down explorer (Start | Shut down | hold CTRL+ALT+Shift and click on the cancel button)
|
|
|
|
b. shut down any other programs running (this is a temp. requirement)
|
|
|
|
c. run: regedit
|
|
|
|
d. navigate to: HKEY_CURRENT_USER\software\microsoft\windows\currentversion\ThemeManager
|
|
|
|
e. change the value of the "ThemeActive" string to "0"
|
|
|
|
f. close "regedit"
|
|
|
|
g. run: explorer
|
|
|
|
h. verfiy that taskbar and start button have returned to normal
|
|
|
|
The file "themeoff.reg" automates the above steps. You can run in using "start themeoff.reg"
|
|
|
|
|
|
To switch to a different "visual style":
|
|
|
|
a. shut down explorer (Start | Shut down | hold CTRL+ALT+Shift and click on the cancel button)
|
|
|
|
b. shut down any other programs running (this is a temp. requirement)
|
|
|
|
c. run: regedit
|
|
|
|
d. navigate to: HKEY_CURRENT_USER\software\microsoft\windows\currentversion\ThemeManager
|
|
|
|
e. change the value of the "DllName" string to be the full path of the .mstheme file
|
|
to be loaded
|
|
|
|
f. change the value of the "ThemeActive" string to "1"
|
|
|
|
g. close "regedit"
|
|
|
|
h. run: explorer
|
|
|
|
i. verfiy that taskbar and start button reflect the new theme
|
|
|
|
|
|
ThemeSel Program:
|
|
-----------------
|
|
themesel.exe is a program designed to test themes (and the theming
|
|
subsystem). It consists of a tabbed set of pages in a window.
|
|
|
|
The main page is labelled "general" and is used to browse and select
|
|
available themes (packaged as .mstheme dll's) and theme directories.
|
|
It can also control special theme loading options (target only 1 app
|
|
or 1 window, etc).
|
|
|
|
When a theme directory is selected and applied by themesel, it
|
|
will call the "packthem" utility to package the theme into a .mstheme
|
|
DLL and then load the DLL as the current theme.
|
|
|
|
The other tabbed pages are used to view the effects of the theme on
|
|
various controls.
|
|
|
|
|
|
ThemeSel and Hooking Services:
|
|
------------------------------
|
|
The loading of system-wide hooks needed by themeing is done in
|
|
explorer.exe. When explorer starts up, it will install the hooks
|
|
if there is a theme active for the current user. ThemeSel will ask
|
|
explorer to install the hooks when themesel is started and there isn't
|
|
a theme active. When ThemeSel exits, it will ask explorer to remove the
|
|
hooks if no theme is currently active.
|
|
|
|
|
|
Packaging Themes:
|
|
-----------------
|
|
|
|
1. a theme directory consists of:
|
|
- a "themes.ini" file
|
|
- one or more "classdata" files
|
|
- all of the image files used by the theme
|
|
- all of the NTL files used by the theme
|
|
|
|
2. the only image files supported in a classdata file are ".bmp" files
|
|
|
|
3. the following files can be converted using "imagecon.exe" to .bmp files:
|
|
|
|
- .jpeg
|
|
- .gif
|
|
- .png
|
|
- .tif
|
|
- .emf
|
|
- .wmf
|
|
- .ico
|
|
|
|
|
|
4. the contents of a theme directory can be packaged into a DLL file by
|
|
using the "packthem.exe" tool. this tool is run automatically by themesel
|
|
when you select a theme directory.
|
|
|
|
5. "packthem" requires that the following tool support files are available in the
|
|
same directory (as packthem.exe) or in your PATH:
|
|
|
|
- link.exe
|
|
- rc.exe
|
|
- cvtres.exe
|
|
- rcdll.dll
|
|
- mspdb60.dll
|
|
|
|
6. the above support files can be copied from: \\rfernand7\public\tak
|
|
|
|
7. packthem takes a directory name as its cmd line argument and processes the "themes.ini" file
|
|
in that directory. For example:
|
|
|
|
packthem subcool
|
|
|
|
8. As the "themes.ini" file is processed:
|
|
|
|
- the file is parsed for syntax errors
|
|
|
|
- the "themes.ini" file is added to the package being built (as a TEXT resource)
|
|
|
|
- recognized properties from the [documentation] section are written to a
|
|
package string table
|
|
|
|
- each color scheme name, display name, and tooltip string are written to
|
|
package string tables
|
|
|
|
- each size name, display name, and tooltip string are written to package
|
|
string tables
|
|
|
|
- each specified classdata file is processed
|
|
|
|
9. As each "classdata" file is processed:
|
|
|
|
- the file is parsed for syntax errors
|
|
|
|
- the classdata file is added to the package being built (as a TEXT resource)
|
|
|
|
- any .bmp "ImageFile" references within the .ini file
|
|
are added to the package (as a resource)
|
|
|
|
- any "NtlFile" references within the .ini file
|
|
are added to the package (as a resource)
|
|
|
|
- any font specifications are written to a package string table
|
|
|
|
9. if no errors are encountered during the above steps, a DLL is produced (the base name
|
|
will be the ending name of the directory; the extension will be ".mstheme").
|
|
|
|
|
|
Unpackaging Themes:
|
|
-------------------
|
|
|
|
Sometimes you will only have the .mstheme file and want to make an adjustment. There is a
|
|
"-u" switch for "packthem.exe" that will let you do this:
|
|
|
|
packthem -u -a professional.mstheme
|
|
|
|
The above cmd will unpack all of the bitmaps and .ini files from professional.mstheme into the
|
|
current directory. The "-a" tells packthem to write the text files as ANSI (default in UNICODE).
|
|
|