Well, i can think of 2 ways:
1: Use the registry. Make some register values with the proper name to save it in. Look in help on TRegistry (hmmm...the spelling..).
2: Make/use a setting-file. This can be done in so many ways but i use to do a:
struct
{
int Printer_Format_Landscape; // true or false
// other settings and such
} Config;
To save the Config:
void __fastcall TForm1::Save_Configuration(char * File_Name)
{
HANDLE Config_File = CreateFile(File_Name,GENERIC_WRITE,0,0,CREATE_ALWAYS,FILE_ATTRIBUTE_ARCHIVE,0);
if(Config_File != INVALID_HANDLE_VALUE)
{
CloseHandle(Config_File);
}
}
To restore the Config:
int __fastcall TForm1::Load_Configuration(char * File_Name)
{
HANDLE Config_File = CreateFile(File_Name,GENERIC_WRITE,0,0,OPEN_EXISTING,FILE_ATTRIBUTE_ARCHIVE,0);
if(Config_File != INVALID_HANDLE_VALUE)
{
CloseHandle(Config_File);
return(true); // All's well
}
return(false); // The file does not exist
}
Totte