Solved

SAVE & REMOVE SKIN

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 84
Delphi - replicating a form 8 65
Open a URL with Internet Explorer in a new tab (not a new window) 1 72
LAN or WAN ? 11 82
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

896 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

13 Experts available now in Live!

Get 1:1 Help Now