Domino Code Fragment

Code Name*
API Call to Retrive Windows System Directory!
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.17.181.21
Description*
Uses the function GeSystemDirectoryA in the Kernel32.DLL to retrive the Windows System directory.
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Parameters: lpBuffer Parameter: A string buffer to load with the system directory name. It should be preallocated to at least nSize+1 characters long. You should usually allocate at least MAX_PATH characters for this buffer. nSize Parameter: Long, the maximum length of the lpBuffer string. Return value: Long - The number of characters loaded into lpBuffer buffer. The required buffer length if lpBuffer is not large enough for the file name.
Files/Graphics attachments (if applicable): Code:
Example:

(Declarations)

Declare Function GetSystemDirectoryA Lib "Kernel32" Alias "GetSystemDirectoryA" (Byval lpBuffer As String, Byval nSize As Long) As Integer

Sub Click(Source As Button)
Dim GetWinDir As String * 127
Dim WinDir As String
Dim Length As Integer
Length=GetSystemDirectoryA(GetWinDir,127)
If Length>0 Then WinDir =Trim(Left(GetWinDir,Length))+"\"
Msgbox WinDir, 64, "Windows Directory"
End Sub