'-----------------------------------------------------------
' FUNCTION: GetWindowsDir
'
' Calls the windows API to get the windows directory and
' ensures that a trailing dir separator is present
'
' Returns: The windows directory
'-----------------------------------------------------------
'
Function GetWindowsDir() As String
Dim strBuf As String
strBuf = Space$(gintMAX_SIZE)
'
'Get the windows directory and then trim the buffer to the exact length
'returned and add a dir sep (backslash) if the API didn't return one
'
If GetWindowsDirectory(strBuf, gintMAX_SIZE) > 0 Then
strBuf = StripTerminator$(strBuf)
AddDirSep strBuf
GetWindowsDir = strBuf
Else
GetWindowsDir = vbNullString
End If
End Function
Share:
These icons link to social bookmarking sites where readers can share and discover new web pages.
