Bonjour,

J'aimerais recupérer le numéro du HD local, j'ai cette fonction qui marche sous Delphi 4 :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function TMenuPrincipal.NumeroSerieDisque(RepertoireRacine : string ) : string ;
var
  NumeroSerieVolume : DWord;
  TailleMaxiNom, OptionsSysteme : DWord;
  NomSystemeFichier : array [0..255] of Char;
  BufferNomVolume : array [0..255] of Char;
begin
  Result := '' ;
  if GetVolumeInformation(PChar(RepertoireRacine)
                          , BufferNomVolume
                          , sizeof( BufferNomVolume )
                          , @NumeroSerieVolume
                          , TailleMaxiNom
                          , OptionsSysteme
                          , NomSystemeFichier   // FAT or NTFS
                          , sizeof( NomSystemeFichier )
                          ) then
  begin
    Result := IntToStr(NumeroSerieVolume);
  end ;
end;
Sous delphi 2005, dans un projet VCL j'ai l'erreur
[Erreur] Menu.pas(55): E2089 Transtypage incorrect
La ligne surligné est : ' , BufferNomVolume'.

Merci