| :: Returns the Windows '95/NT Directory... |
Author |
Tessarollo Livio |
Language |
VB5, VB6 |
Operating
Systems |
Windows 95, 98 and NT |
| API
Declarations |
Option Explicit
Private Declare Function GetWindowsDirectory Lib "kernel32.dll" Alias
"GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long |
| Module |
'---------------------------------------------
' get Windows '95/NT directory
'---------------------------------------------
Public Function GetWindows() As String
Dim RetVal As String
Dim AppName As String
Dim worked As Long
RetVal = String$(144, 0)
worked = GetWindowsDirectory(RetVal, Len(RetVal))
If worked = 0 Then
GetWindows = "unknown"
Else
GetWindows = Left(RetVal, worked)
End If
End Function |
| Usage |
'Usage:
Private Sub Command1_Click()
MsgBox GetWindows()
End Sub |
|
 |
|
 |