Gruppe
API
Problem
Das Windows-Verzeichnis soll ermittelt werden.
StandardModule: Modul1
Declare Function GetWindowsDirectory Lib "kernel32.dll" _
Alias "GetWindowsDirectoryA" ( _
ByVal lpBuffer As String, ByVal nSize As Long) As Long
Sub WindowsFolder()
Dim lLength As Long
Dim sWinDir As String
sWinDir = Space(255)
lLength = GetWindowsDirectory(sWinDir, 255)
sWinDir = Left(sWinDir, lLength)
MsgBox "Das Windows-Verzeichnis: " & sWinDir
End Sub