Domino Code Fragment

Code Name*
API Call to WIN32 to Utilize Windows Get File dialogbox. (Win95 Version)
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.119.133.228
Description*
Brings up the Win95 get file dialog and allows you to select a file.
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
This works on Win95, the reason it does not work on WinNT is because the Alias GetSaveFileNameA is the Ascii version of this function. WinNT utilizes the UNICODE version.
Files/Graphics attachments (if applicable): Code:

(Declarations)

Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type


Declare Function GetSaveFileNameA Lib "comdlg32.dll" Alias "GetSaveFileNameA"_
(pOpenfilename As OPENFILENAME) As Long



Sub Click(Source As Button)
    Dim toto As OPENFILENAME
    Dim llret As Long
    Dim lsPath As String
   
    Dim workspace As New NotesUIWorkspace
    Dim uidoc As NotesUIDocument
    Set uidoc = workspace.CurrentDocument
   
    toto.lStructSize = Len(toto)
    toto.hwndOwner = 0
    toto.lpstrFilter = ""
    toto.lpstrCustomFilter = ""
    toto.nMaxCustFilter = 0
    toto.lpstrFile = Space(50)
    toto.nMaxFile = Len(toto.lpstrFilter)
    toto.lpstrFileTitle = Space(50)
    toto.nMaxFileTitle = Len(toto.lpstrFileTitle)
    toto.lpstrInitialDir = "c:\"
    toto.lpstrTitle = "Select directory"
    toto.nFileOffset = 0
    toto.nFileExtension = 0
    toto.lpstrDefExt = "txt"
    toto.lCustData = 0
   
    llRet = GetSaveFileName(toto)
   
    If Right(Curdir,1) = "\" Then
         lsChaine = Curdir & toto.lpstrFileTitle
    Else
         lsChaine = Curdir & "\" & toto.lpstrFileTitle
    End If
   
    If toto.lpstrFileTitle <> Space(50) Then
         Messagebox Ucase(Trim(lsChaine)), 64, "This is Your File"

     End If
End Sub