Accueil > > > INFORMATIONS SUR L'APPLICATION (VERSION, COPYRIGHT, ETC...)
INFORMATIONS SUR L'APPLICATION (VERSION, COPYRIGHT, ETC...)
Information sur la source
Description
En fait, Nono40 a déjà posé une source dans ce style, mais qui ne renvoyait que la version de l'application... Ceci est une version un peu plus complète, tout est expliqué dans le code, c'est facile ! Et c'est toujours utile...
Source
- //--------------------------------------------------------------------------
- // Auteur : David Laumaillé
- //
- // Date : 26/05/2005
- //--------------------------------------------------------------------------
- // Fonction : InfosFichier
- //
- // Description : Cette fonction renvoie une information sur un fichier,
- // ou toutes les informations standard.
- //
- // Entrée : Une chaîne contenant la désignation de l'information demandée.
- //
- // Sortie : Une chaine contenant la valeur de l'information demandée.
- //
- // Remarque : Si on passe une chaine vide en paramètre, la fonction renvoie
- // une description standard des informations du fichier.
- // Si l'information n'existe pas, on renvoie une chaîne vide.
- //--------------------------------------------------------------------------
- // Liste des informations standards :
- // - Comments
- // - CompanyName
- // - FileDescription
- // - FileVersion
- // - InternalName
- // - LegalCopyright
- // - LegalTrademarks
- // - OriginalFileName
- // - ProductVersion
- // - ProductName
- //--------------------------------------------------------------------------
-
- //--------------------------------------------------------------------------
- // Unités utilisées
- //--------------------------------------------------------------------------
- uses Windows, Forms;
-
-
- Function InfosFichier(sInfo: String): String;
- //--------------------------------------------------------------------------
- // InfosFichier
- //--------------------------------------------------------------------------
- const
- iInfo = 10;
- aInfo: array[1..iInfo] of string = ('Comments', 'CompanyName', 'FileDescription', 'FileVersion', 'InternalName', 'LegalCopyright', 'LegalTrademarks', 'OriginalFileName', 'ProductVersion', 'ProductName');
- aInfoFR: array[1..iInfo] of string = ('Commentaires', 'Entreprise', 'Description', 'Version du fichier', 'Nom interne', 'Copyright', 'Marques légales', 'Nom du fichier d''origine', 'Version du produit', 'Nom du produit');
- var
- sAppName: string;
- n, Len, i: DWORD;
- Buf: PChar;
- Value: PChar;
- begin
- Result := '';
- sAppName := Application.ExeName;
- n := GetFileVersionInfoSize(PChar(sAppName), n);
-
- if n > 0 then begin
- Buf := AllocMem(n);
- Result := 'Taille des infos = ' + IntToStr(n);
- GetFileVersionInfo(PChar(sAppName), 0, n, Buf);
-
- if sInfo = '' then begin
- for i := 1 to iInfo do
- if VerQueryValue(Buf, PChar('StringFileInfo\040C04E4\' + aInfo[i]), Pointer(Value), Len) then
- Result := Result + #13#10 + aInfoFR[i] + ' = ' + Value;
- FreeMem(Buf, n);
- end else begin
- if VerQueryValue(Buf, PChar('StringFileInfo\040C04E4\' + sInfo), Pointer(Value), Len) then
- Result := Value;
- FreeMem(Buf, n);
- end;
-
- end;
-
- end;
//--------------------------------------------------------------------------
// Auteur : David Laumaillé
//
// Date : 26/05/2005
//--------------------------------------------------------------------------
// Fonction : InfosFichier
//
// Description : Cette fonction renvoie une information sur un fichier,
// ou toutes les informations standard.
//
// Entrée : Une chaîne contenant la désignation de l'information demandée.
//
// Sortie : Une chaine contenant la valeur de l'information demandée.
//
// Remarque : Si on passe une chaine vide en paramètre, la fonction renvoie
// une description standard des informations du fichier.
// Si l'information n'existe pas, on renvoie une chaîne vide.
//--------------------------------------------------------------------------
// Liste des informations standards :
// - Comments
// - CompanyName
// - FileDescription
// - FileVersion
// - InternalName
// - LegalCopyright
// - LegalTrademarks
// - OriginalFileName
// - ProductVersion
// - ProductName
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
// Unités utilisées
//--------------------------------------------------------------------------
uses Windows, Forms;
Function InfosFichier(sInfo: String): String;
//--------------------------------------------------------------------------
// InfosFichier
//--------------------------------------------------------------------------
const
iInfo = 10;
aInfo: array[1..iInfo] of string = ('Comments', 'CompanyName', 'FileDescription', 'FileVersion', 'InternalName', 'LegalCopyright', 'LegalTrademarks', 'OriginalFileName', 'ProductVersion', 'ProductName');
aInfoFR: array[1..iInfo] of string = ('Commentaires', 'Entreprise', 'Description', 'Version du fichier', 'Nom interne', 'Copyright', 'Marques légales', 'Nom du fichier d''origine', 'Version du produit', 'Nom du produit');
var
sAppName: string;
n, Len, i: DWORD;
Buf: PChar;
Value: PChar;
begin
Result := '';
sAppName := Application.ExeName;
n := GetFileVersionInfoSize(PChar(sAppName), n);
if n > 0 then begin
Buf := AllocMem(n);
Result := 'Taille des infos = ' + IntToStr(n);
GetFileVersionInfo(PChar(sAppName), 0, n, Buf);
if sInfo = '' then begin
for i := 1 to iInfo do
if VerQueryValue(Buf, PChar('StringFileInfo\040C04E4\' + aInfo[i]), Pointer(Value), Len) then
Result := Result + #13#10 + aInfoFR[i] + ' = ' + Value;
FreeMem(Buf, n);
end else begin
if VerQueryValue(Buf, PChar('StringFileInfo\040C04E4\' + sInfo), Pointer(Value), Len) then
Result := Value;
FreeMem(Buf, n);
end;
end;
end;
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
L'INTERFACE NATURELLE DE WINDOWS PHONE 7 SERIESL'INTERFACE NATURELLE DE WINDOWS PHONE 7 SERIES par odewit
La tendance est aux interfaces naturelles (NUI), et le keynote de Bill Buxton au MIX l'a bien souligné.
La charte graphique et ergonomique de Windows Phone 7 a donc été entièrement repensée en vue d'obtenir un maximum d'efficacité sur ce point. En re...
Cliquez pour lire la suite de l'article par odewit COMMENT MAPPER UNE VUE SQL SUR UNE COLLECTION DE COMPLEX TYPE?COMMENT MAPPER UNE VUE SQL SUR UNE COLLECTION DE COMPLEX TYPE? par Matthieu MEZIL
Avec EF, les vues doivent être mappées sur des entity types. Le problème c'est que les entity types doivent avoir une clé. Avec EF, nous avons les complex type qui n'ont pas de clé mais les vues ne peuvent pas être mappées dessus. Avec EF4, il est possibl...
Cliquez pour lire la suite de l'article par Matthieu MEZIL [WF4] UN BINDING ACTIVITY/ACTIVITYDESIGNER QUI PASSE MAL?[WF4] UN BINDING ACTIVITY/ACTIVITYDESIGNER QUI PASSE MAL? par JeremyJeanson
Certain d'entre vous on peut être vécu cette situation embarrassante après quelques temps passer avec WF4 : Au début avec mon " ActivityDesigner" , tout allait bien. Et puis un jour j'ai au des problèmes de " Binding" . Alors nous sommes allé sur le site ...
Cliquez pour lire la suite de l'article par JeremyJeanson
Forum
QREPORT QREPORT par lounnaci
Cliquez pour lire la suite par lounnaci [à SUPPRIMER][à SUPPRIMER] par br1969
Cliquez pour lire la suite par br1969
Logiciels
Academy System (10.9.4.0)ACADEMY SYSTEM (10.9.4.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Xilisoft Convertisseur Vidéo Ultimate (5.1.39.0305)XILISOFT CONVERTISSEUR VIDéO ULTIMATE (5.1.39.0305)Xilisoft Convertisseur Vidéo Ultimate est un outil puissant de conversion vidéo, facile à utilise... Cliquez pour télécharger Xilisoft Convertisseur Vidéo Ultimate Xilisoft DVD Ripper Ultimate (5.0.64.0304)XILISOFT DVD RIPPER ULTIMATE (5.0.64.0304)Xilisoft DVD Ripper Ultimate est un logiciel excellent pour copier et convertir DVD vers presque ... Cliquez pour télécharger Xilisoft DVD Ripper Ultimate Rigs of Rods (63.3)RIGS OF RODS (63.3)c'est un jeu de multi-simulation camions,autobus voitures, avions, bateaux, hélicoptère avec défo... Cliquez pour télécharger Rigs of Rods
|