Solved

SAVE & REMOVE SKIN

Posted on 2003-11-01
2
208 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
FMX enumerated colours 2 115
Delphi inherited method 6 75
Performance of SQL statement 37 125
Not able to call Delphi XE10 dll function from Delphi 6.0 4 37
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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

789 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