Ovaj kod ide u Moduel... On je namjenjen da traži Windows Folder a meni treba taki kod koji traži Program Files... može li neko to napravit za Program Files?
Code:
Public Const max_path = 260
Public Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" _
(ByVal lpbuffer As String, ByVal nsize As Long) As Long
Public Function WinDir_func() As String
Dim lpbuffer As String
Dim windir As String
lpbuffer = Space$(max_path)
WinDir_func = Left$(lpbuffer, GetWindowsDirectory(lpbuffer, max_path))
' save default windows path in this variable :)
End Function
Public Const max_path = 260
Public Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" _
(ByVal lpbuffer As String, ByVal nsize As Long) As Long
Public Function WinDir_func() As String
Dim lpbuffer As String
Dim windir As String
lpbuffer = Space$(max_path)
WinDir_func = Left$(lpbuffer, GetWindowsDirectory(lpbuffer, max_path))
' save default windows path in this variable :)
End Function