Einzelnen Beitrag anzeigen

Michael II

Registriert seit: 1. Dez 2012
Ort: CH BE Eriswil
778 Beiträge
 
Delphi 11 Alexandria
 
#4

AW: Sprach ID aus Exe auslesen

  Alt 17. Jul 2025, 14:22
Dies funktioniert bei meiner App. (Copilot )
Delphi-Quellcode:
procedure sprachIDCodepage;
var
  InfoSize: DWORD;
  InfoData: Pointer;
  Translation: Pointer;
  TranslationLen: UINT;
  LangID, CodePage: Word;
begin
  InfoSize := GetFileVersionInfoSize(PChar(ParamStr(0)), InfoSize);
  if InfoSize > 0 then
  begin
    GetMem(InfoData, InfoSize);
    try
      if GetFileVersionInfo(PChar(ParamStr(0)), 0, InfoSize, InfoData) then
      begin
        if VerQueryValue(InfoData, '\VarFileInfo\Translation', Translation, TranslationLen) then
        begin
          LangID := MakeWord(PByte(Translation)^, PByte(Integer(Translation) + 1)^);
          CodePage := MakeWord(PByte(Integer(Translation) + 2)^, PByte(Integer(Translation) + 3)^);
          ShowMessage(Format('Sprach-ID: %x, Codepage: %x', [LangID, CodePage]));
        end;
      end;
    finally
      FreeMem(InfoData);
    end;
  end;
end;
Michael Gasser
  Mit Zitat antworten Zitat