Thema: Delphi TExtraResManager

Einzelnen Beitrag anzeigen

jonny

Registriert seit: 15. Dez 2003
235 Beiträge
 
Delphi 7 Enterprise
 
#5

Re: TExtraResManager

  Alt 8. Feb 2004, 14:20
OK Schreiben in eine EXE Datein:

Delphi-Quellcode:
  ExtraResManager.AddFile(edSoundFileName.Text, 1, 'Sound');
  ExtraResManager.AddFile(edLogoFileName.Text, 2, 'Logo');
  ExtraResManager.AddFile(ExtractFilePath(Application.ExeName) + cboxLanguages.Text + '.lng', 3, 'Language');
  ExtraResManager.SaveToEXEFile(FolderDialog.Directory + '\Anwendung.exe');
Lesen aus der EXE (sichselber):

Delphi-Quellcode:
  If ExtraResManager.HasExtraResources(Application.ExeName) Then
  begin
    ExtraResManager.LoadFromEXEFile(Application.ExeName);
    For I:=0 To ExtraResManager.Resources.Count - 1 Do
    begin
      If ExtraResManager.Resources.Items[I].ResName = 'SoundThen
        ExtraResManager.Resources.Items[I].SaveToFile('C:\sound.wav')
      else
      If ExtraResManager.Resources.Items[I].ResName = 'LogoThen
        ExtraResManager.Resources.Items[I].SaveToFile('C:\logo.bmp')
      else
      If ExtraResManager.Resources.Items[I].ResName = 'LanguageThen
        ExtraResManager.Resources.Items[I].SaveToFile('C:\language.lng');
    end;
  end;
  Mit Zitat antworten Zitat