newman     VBWeb     VBSource     Portfolio    

WinDir

ShellModal

TOP TEN
Returns the full path of the Windows directory.
Syntax
Path = WinDir()


Source
#If Win32 Then ' 32-bit VB uses this Declare.
    Declare Function GeneralWinDirApi Lib "kernel32" _
        Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, _
        ByVal nSize As Long) As Long
#Else   ' 16-bit VB uses this Declare.
    Declare Function GeneralWinDirApi Lib "Kernel" _
        Alias "GetWindowsDirectory" (ByVal lpBuffer As String, _
        ByVal nSize As Integer) As Integer
#End If

Function WinDir() As String
    Const FIX_LENGTH% = 4096
    Dim Length As Integer
    Dim Buffer As String * FIX_LENGTH

    Length = GeneralWinDirApi(Buffer, FIX_LENGTH - 1)
    WinDir = Left$(Buffer, Length)
End Function
	


Feedback Comments
Return Address (if you want a reply)


Copyright 1997 NEWMAN Services Corp. All rights reserved.
973-228-5753 pres@newmanservices.com
DECONSTRUCT THIS PAGE