Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Visual Basic >> Snippet

Get Windows and System directories


Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" ( _
       ByVal lpBuffer As String , ByVal nSize As Long )    As Long

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


Dim iReturn As Long
Dim Buffer As String * 256
iReturn   = GetSystemDirectory(Buffer, Len(Buffer)) ' Buffer will hold return value
iReturn   = GetWindowsDirectory(Buffer, Len(Buffer)) ' Buffer will hold return value