|
-
Feb 2nd, 2004, 09:03 PM
#1
Thread Starter
Frenzied Member
[VB] GetWinDir
Public Declare Function GetWindowsDirectory Lib "kernel32" _
Alias "GetWindowsDirectoryA" _
(ByVal lpBuffer As String, ByVal nSize As Long) As Long
Public Function GetWinDir() As String
Dim windir As String ' receives path of Windows directory
Dim SLength As Long ' receives length of the string returned
windir = Space(255) ' initialize buffer to receive the string
SLength = GetWindowsDirectory(windir, 255) ' read the path of the Windows directory
windir = Left(windir, SLength) ' extract the returned string from the buffer
GetWinDir = windir
End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|