tutorials.de Buch-Aktion 05/2012
ERLEDIGT
NEIN
ANTWORTEN
2
ZUGRIFFE
659
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
AUF DIESES THEMA
ANTWORTEN
  1. #1
    Registriert seit
    Oct 2001
    Ort
    Lemgo (NRW)
    Beiträge
    116
    folgendes problem:

    in delphi (in meinem fall version 6) isses ja möglich in den project-options die programm version mit einzubinden, also muss es doch auch möglich sein diese abzufragen, und dann zum beispiel in form1.caption anzuzeigen
    also: form1.caption:='Mein tolles Programm' + version

    wär cool wenn mir da wer helfen könnte, thx schon ma im vorraus
     
    For all the motherfuckin losers in the world who have tried to put me down. As the Indians fought and died for their way of life, so shall I.
    Great Spirit, I only whish to live long enough to Piss on the graves of my enemies. ©Manowar
    ------------------
    N I C

  2. #2
    Avatar von nexus
    nexus nexus ist offline Mitglied Bronze
    Registriert seit
    Jan 2002
    Ort
    BW, 8****
    Beiträge
    32
    Hi,
    die Version läßt sich über folgende Funktion abfragen.
    Der Funktion wird ein Dateinahme übergeben.
    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    
    function GetVersion(Datei: string): string;
     
    var  aFileName: array [0..MAX_PATH] of Char;
     
      pdwHandle: DWORD;
     
      nInfoSize: DWORD;
     
      pFileInfo: Pointer;
     
      pFixFInfo: PVSFixedFileInfo;
     
      nFixFInfo: DWORD;
     
      pVarFInfo: PChar;
     
      nVarFInfo: DWORD;
     
      nVarTrans: DWORD;
     
      aVarFPath: array [0..MAX_PATH] of Char;
     
    begin
     
      //Gibt Versionsnummer zurück
     
      StrPCopy(aFileName,Datei);
     
      pdwHandle := 0;
     
      nInfoSize := GetFileVersionInfoSize(aFileName, pdwHandle);
     
      result:='0';
     
      if nInfoSize <> 0 then
     
        pFileInfo := GetMemory(nInfoSize)
     
      else
     
        pFileInfo := nil;
     
      if Assigned(pFileInfo) then
     
      try
     
        if GetFileVersionInfo(aFileName, pdwHandle, nInfoSize, pFileInfo) then
     
        begin
     
          pFixFInfo := nil;
     
          nFixFInfo := 0;
     
          if VerQueryValue(pFileInfo, '\', Pointer(pFixFInfo), nFixFInfo) then
     
          begin
     
            result := Format('%d.%d.%d.%d',[HiWord(pFixFInfo^.dwFileVersionMS),
     
            LoWord(pFixFInfo^.dwFileVersionMS),HiWord(pFixFInfo^.dwFileVersionLS),
     
            LoWord(pFixFInfo^.dwFileVersionLS)]);
     
          end;
     
        end;
     
      finally
     
        FreeMemory(pFileInfo);
     
      end;
     
    end;
     

  3. #3
    Registriert seit
    Oct 2001
    Ort
    Lemgo (NRW)
    Beiträge
    116
    perfekt, du bistn gott
    dnagge für deine hilfe, ****t super!
    (hätte nich gedacht, dass das sooo umständlich is...aber egal )
     
    For all the motherfuckin losers in the world who have tried to put me down. As the Indians fought and died for their way of life, so shall I.
    Great Spirit, I only whish to live long enough to Piss on the graves of my enemies. ©Manowar
    ------------------
    N I C

Ähnliche Themen

  1. Versions-sniffer
    Von mardazad im Forum Flash Plattform
    Antworten: 0
    Letzter Beitrag: 07.07.08, 14:48
  2. JRE Versions-Problem
    Von sabine1 im Forum Java
    Antworten: 5
    Letzter Beitrag: 08.08.07, 17:41
  3. Flash Versions Check
    Von Firefighter86 im Forum Flash Plattform
    Antworten: 7
    Letzter Beitrag: 23.12.06, 15:16
  4. SQL-Versions- und /PHP-Problem
    Von dennisnowack im Forum Relationale Datenbanksysteme
    Antworten: 3
    Letzter Beitrag: 11.03.05, 19:40
  5. Flash Versions-Prüfung
    Von 3Dnavigator im Forum Flash Plattform
    Antworten: 11
    Letzter Beitrag: 08.05.03, 18:20