Domino Code Fragment

Code Name*
API Call to Retrive Windows System Directory!
Date*
11/10/2024
Source (or email address if you prefer)*
[email protected]
IP address:.172.70.127.122
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