Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
API Help!
Message
 
À
27/09/2000 15:49:04
Information générale
Forum:
Visual Basic
Catégorie:
Fonctions API de Windows
Titre:
Divers
Thread ID:
00421727
Message ID:
00421828
Vues:
18
>I'm using API GetSystemDirectory, it returns a Long. How I get the name of that long? I mean, how I get "c:\Windows\System"....
>
>Anyone knows the answer???
>
>Thanks.

This way:
Private Declare Function GetSystemDirectory _
                Lib "kernel32" _
                Alias "GetSystemDirectoryA" _
                (ByVal lpBuffer As String, _
                 ByVal nSize As Long _
                ) As Long

Public function GetWindowsDir() as string
Dim lngResult As Long
Dim strDir As String

   strDir = Space$(260)
   lngResult = GetSystemDirectory(strDir, Len(strDir))
   GetWindowsDir = Left$(strDir, lngResult)
   MsgBox GetWindowsDir
End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform