This is something I have been thinking about making for a long
time. What is a theme? Basically, it is a collection of sounds,
cursors, icons and background pictures that are used to create a
desktop. Here is a picture of my desktop.
Now the hardest part of a theme isn't getting sound files, or
icons, or even the background picture. The hardest part is the
theme file itself. I have talked with several people on the net,
they have all the files to make a theme but they hate the fact
that the .the file is so hard. Where there is a problem in
software, there is a programmer hard at work trying to get the
solution.
Those people that I talked to are my focus group. I would go
to these people in the design phase of the program to learn what
features and special abilities this program should have. After
the focus group is done talking, the research and development
team tell the programmers what to do.
First, what will this program do? It will let the user type in
or browse in the name of the files to be put into the theme, and
then create the theme.
Sounds easy? Usually, the main idea of a program is easy but
the implementation is killer. "Create a program off of Dos
to give users a graphical representation of their computer's hard
drive", translates to Windows' 10 million lines of code.
Okay, let's examine what is in a .the file. It is basically a
text file with the .the suffix. That means we can open a stream
and create a theme file easy. Let's open up a regular theme file
with Reader. We then get a text file that reads:
This will let you skip down to where I start talking
again.
;Copyright © Microsoft Corp. 1995
[CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\DefaultIcon]
DefaultValue=%ThemeDir%Inside your Computer My Computer.ico
[CLSID\{208D2C60-3AEA-1069-A2D7-08002B30309D}\DefaultIcon]
DefaultValue=%ThemeDir%Inside your Computer Network
Neighborhood.ico
[CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\DefaultIcon]
full=%ThemeDir%Inside your Computer Recycle Full.ico,0
empty=%ThemeDir%Inside your Computer Recycle Empty.ico,0
[Control Panel\Colors]
ActiveTitle=224 0 0
Background=0 0 0
Hilight=248 255 160
HilightText=0 0 0
TitleText=255 255 255
Window=255 255 255
WindowText=0 0 0
Scrollbar=216 224 216
InactiveTitle=96 168 128
Menu=168 200 168
WindowFrame=0 0 0
MenuText=0 0 0
ActiveBorder=168 200 168
InactiveBorder=168 200 168
AppWorkspace=80 143 108
ButtonFace=168 200 168
ButtonShadow=96 152 96
GrayText=96 152 96
ButtonText=0 0 0
InactiveTitleText=216 224 216
ButtonHilight=216 224 216
ButtonDkShadow=0 0 0
ButtonLight=168 200 168
InfoText=0 72 72
InfoWindow=255 239 210
[Control Panel\Cursors]
Arrow=%ThemeDir%Inside your Computer arrow.cur
Help=%ThemeDir%Inside your Computer help.cur
AppStarting=%ThemeDir%Inside your Computer wait.ani
Wait=%ThemeDir%Inside your Computer busy.ani
NWPen=%ThemeDir%Inside your Computer pen.cur
No=%ThemeDir%Inside your Computer no.cur
SizeNS=%ThemeDir%Inside your Computer Size NS.cur
SizeWE=%ThemeDir%Inside your Computer Size WE.cur
Crosshair=%ThemeDir%Inside your Computer cross.cur
IBeam=%ThemeDir%Inside your Computer beam.cur
SizeNWSE=%ThemeDir%Inside your Computer Size NWSE.cur
SizeNESW=%ThemeDir%Inside your Computer Size NESW.cur
SizeAll=%ThemeDir%Inside your Computer move.cur
UpArrow=%ThemeDir%Inside your Computer up.cur
DefaultValue=Windows default
[Control Panel\Desktop]
Wallpaper=%ThemeDir%Inside your Computer wallpaper.jpg
TileWallpaper=0
Pattern=(None)
ScreenSaveActive=1
[Control Panel\Desktop\WindowMetrics]
[AppEvents\Schemes\Apps\.Default\.Default\.Current]
DefaultValue=%ThemeDir%Inside your Computer default sound.wav
[AppEvents\Schemes\Apps\.Default\AppGPFault\.Current]
DefaultValue=%ThemeDir%Inside your Computer program error.wav
[AppEvents\Schemes\Apps\.Default\Maximize\.Current]
DefaultValue=%ThemeDir%Inside your Computer maximize.wav
[AppEvents\Schemes\Apps\.Default\MenuCommand\.Current]
DefaultValue=%ThemeDir%Inside your Computer menu command.wav
[AppEvents\Schemes\Apps\.Default\MenuPopup\.Current]
DefaultValue=%ThemeDir%Inside your Computer menu popup.wav
[AppEvents\Schemes\Apps\.Default\Minimize\.Current]
DefaultValue=%ThemeDir%Inside your Computer minimize.wav
[AppEvents\Schemes\Apps\.Default\Open\.Current]
DefaultValue=
[AppEvents\Schemes\Apps\.Default\Close\.Current]
DefaultValue=
[AppEvents\Schemes\Apps\.Default\RestoreDown\.Current]
DefaultValue=%ThemeDir%Inside your Computer Restore Down.wav
[AppEvents\Schemes\Apps\.Default\RestoreUp\.Current]
DefaultValue=%ThemeDir%Inside your Computer Restore Up.wav
[AppEvents\Schemes\Apps\.Default\RingIn\.Current]
DefaultValue=
[AppEvents\Schemes\Apps\.Default\Ringout\.Current]
DefaultValue=
[AppEvents\Schemes\Apps\.Default\SystemAsterisk\.Current]
DefaultValue=%ThemeDir%Inside your Computer asterisk.wav
[AppEvents\Schemes\Apps\.Default\SystemDefault\.Current]
DefaultValue=%ThemeDir%Inside your Computer beep.wav
[AppEvents\Schemes\Apps\.Default\SystemExclamation\.Current]
DefaultValue=%ThemeDir%Inside your Computer exclamation.wav
[AppEvents\Schemes\Apps\.Default\SystemExit\.Current]
DefaultValue=%ThemeDir%Inside your Computer exit windows.wav
[AppEvents\Schemes\Apps\.Default\SystemHand\.Current]
DefaultValue=%ThemeDir%Inside your Computer critical stop.wav
[AppEvents\Schemes\Apps\.Default\SystemQuestion\.Current]
DefaultValue=%ThemeDir%Inside your Computer question.wav
[AppEvents\Schemes\Apps\.Default\SystemStart\.Current]
DefaultValue=%ThemeDir%Inside your Computer startup.wav
[AppEvents\Schemes\Apps\Explorer\EmptyRecycleBin\.Current]
DefaultValue=%ThemeDir%Inside your Computer empty recycle bin.wav
[Metrics]
IconMetrics=76 0 0 0 96 0 0 0 83 0 0 0 1 0 0 0 241 255 255 255 0
0 0 0 0 0 0 0 0 0 0 0 144 1 0 0 0 0 0 0 0 0 0 0 65 98 97 100 105
32 77 84 32 67 111 110 100 101 110 115 101 100 32 76 105 103 104
116 0 119 97 118 0 98 105 110
NonclientMetrics=84 1 0 0 1 0 0 0 16 0 0 0 16 0 0 0 20 0 0 0 20 0
0 0 240 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 188 2 0 0 0 0 0 0 0 0
0 0 65 98 97 100 105 32 77 84 32 67 111 110 100 101 110 115 101
100 32 76 105 103 104 116 0 112 82 129 124 76 11 193 17 0 0 0 17
0 0 0 243 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 188 2 0 0 0 0 0 0 0
0 0 0 65 98 97 100 105 32 77 84 32 67 111 110 100 101 110 115 101
100 32 76 105 103 104 116 0 112 82 129 124 76 11 193 19 0 0 0 19
0 0 0 241 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 144 1 0 0 0 0 0 0 0
0 0 0 65 98 97 100 105 32 77 84 32 67 111 110 100 101 110 115 101
100 32 76 105 103 104 116 0 112 82 129 124 76 11 193 241 255 255
255 0 0 0 0 0 0 0 0 0 0 0 0 144 1 0 0 0 0 0 0 0 0 0 0 65 98 97
100 105 32 77 84 32 67 111 110 100 101 110 115 101 100 32 76 105
103 104 116 0 112 82 129 124 76 11 193 244 255 255 255 0 0 0 0 0
0 0 0 0 0 0 0 144 1 0 0 0 0 0 0 0 0 0 0 65 98 97 100 105 32 77 84
32 67 111 110 100 101 110 115 101 100 32 76 105 103 104 116 0 112
82 129 124 76 11 193
[boot]
SCRNSAVE.EXE=%WinDir%\System\Inside your Computer.SCR
[MasterThemeSelector]
MTSM=DABJDKT
ThemeColorBPP=8
Stretch=1
Very Large!!
It's big and some of this stuff doesn't make sense. Don't
worry. In our first version, we don't have to allow the user the
ability to change everything.
Let's break this thing down into pieces. First, how the heck
is this program going to work.
- I will need to get the names of the files that will be
entered into the program.
- I will then copy the files over to a folder of the user's
choosing.
- Then I will create the .the file.
1. What would be the best way to get those people's names. I
would basically use the same bit of code when it comes to asking
for the file names:
cout<<"Please enter the name of
"<<filename<<endl;
cin>>thefilename;
That is a little simplified but it is about what I will be
doing over and over. What do we do when it looks like we are
doing the same code repeatedly? We turn it into a function! This
function will need to pass in the name of the type of file to be
read and also be able to pass out the name of the file and where
it is. In other words, pass in two variables.
2. Set up an ofstream to create a folder and start pumping all the files into
the folder. This will make it easier to zip and ship.
3.
Make another function that will create the .the.
First:
cout<<"What is the name of the output file?"<<endl;
//use a char [255]
cin>>filename; //we have the filename!!
.........
ofstream c_out(filename); // it SHOULD be open
if ( c_out ) { //check to see if the stream has been created
//if it is good start working on it!
c_out<<"Blah,blah, microsoft stuff,blahblah: "<<startup_sound<<endl;
//repeat until done
) //done working on it
else {
cerr<<"Error: Couldn't open file. Check to see if the drive is
readable."<<endl;}
That would be the main part of creating the program.
Easy ain't it. Now we just have to code it and sent it to the testers. Since
I have the fortune of having C++ Builder, I can create a nice Windows version.
Stay tuned as next week, I will continue this.
Return to the index.