Source Code :
Declare Function GetSystemDirectory Lib "kernel32" _ Alias "GetSystemDirectoryA" _ (ByVal lpBuffer As String, _ ByVal nSize As Long) As Long Declare Function GetWindowsDirectory Lib "kernel32" _ Alias "GetWindowsDirectoryA" _ (ByVal lpBuffer As String, _ ByVal nSize As Long) As Long Public Function GetWindowsDir() As String Dim sDir As String * 255 Dim iReturn As Integer Dim lSize As Long sDir = Space$(255) lSize = Len(sDir) iReturn = GetWindowsDirectory(sDir, lSize) GetWindowsDir = Left$(sDir, InStr(1, sDir, Chr$(0)) - 1) End Function Public Function GetSystemDir() As String Dim sDir As String * 255 Dim iReturn As Integer Dim lSize As Long sDir = Space$(255) lSize = Len(sDir) iReturn = GetSystemDirectory(sDir, lSize) GetSystemDir = Left$(sDir, InStr(1, sDir, Chr$(0)) - 1) End Function
0 comments:
Post a Comment