Solved

SAVE & REMOVE SKIN

Posted on 2003-11-01
2
210 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

695 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