Private Declare Function GetSystemDirectory Lib "kernel32.dll" Alias "GetSystemDirectoryA" _
(ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Declare Function GetWindowsDirectory Lib "kernel32.dll" Alias "GetWindowsDirectoryA" _
(ByVal lpBuffer As String, ByVal uSize As Long) As Long
Private Sub Form_Load()
Dim temp As String
temp = String(260, Chr(0))
Call GetWindowsDirectory(temp, Len(temp))
Me.Text1(0).Text = temp
temp = String(260, Chr(0))
Call GetSystemDirectory(temp, Len(temp))
Me.Text1(1).Text = temp
End Sub |