Solved

SAVE & REMOVE SKIN

Posted on 2003-11-01
2
203 Views
Last Modified: 2010-04-05
In my application there is option for user to applay skin or remove skin...
How to save this option next time when the user run the application?
If user select remove skin and close application then It must be without skin when HE/SHE open it.
0
Comment
Question by:sal1150
2 Comments
 
LVL 5

Expert Comment

by:DeerBear
ID: 9665202
Hi,

You have several ways to do it:
1) Registry
2) Ini file
3) Configuration file

For the first two options, there are two classes that
come to help: TRegistry and TIniFile.

As to the latter, I'm afraid you should create your own code.

Personally, I would suggest the Ini file since it doesn't spoil
registry and is easy to port also under Linux.

HTH,

Andrew
0
 
LVL 5

Accepted Solution

by:
Hypoviax earned 50 total points
ID: 9675638
Use Inifiles they are easy

1) in the units add 'inifiles'
2) On form close add code of similar form:

var inifile:tinifile;
Begin
inifile:=tinifile.create(extractfilepath(appliciation.exename) + 'Myskin.ini');
with inifile do
  begin
   writestring('Mainform','Skin',FILEPATHOFSKINHERE);
   free
  end
End;

3)On form load do something like this:
Make a private or public global variable 'str' as a string
Have your procedure for loading skin declared similarly

var inifile:tinifile;
Begin
inifile:=tinifile.create(extractfilepath(appliciation.exename) + 'Myskin.ini');
with inifile do
  begin
   str:=readstring('Mainform','Skin',DEFAULTFILEPATHHERE);
   free
  end
loadskin(str) //call load skin procedure
End;

procedure tform1.loadskin(FILEPATH:string); //This is just as an example i have no idea    
                                                                           //how you load them
begin
Skin.filepath:=FILEPATH;
skin.loadskin
end;

Hope this helps,

Hypoviax

0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now