Solved

SAVE & REMOVE SKIN

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi Dbf export problem to a Visual Foxpro application 6 234
error 1.1 400 Bad request idhttp delphi 18 208
JAudiorecorder record freezing the app 29 83
MS Access from Delphi 31 81
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 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