File Selection

Started by Martin Francom, May 30, 2013, 07:22:39 PM

Previous topic - Next topic

Martin Francom

It's been a long while since I last wrote a FF program (or any program) and I am having a mental block.  This should be really simple but I can seem to get it right. I have look in the example folder to see if there were any examples that would help me figure this out but didn't find what I need.  Hope someone can giive me some help.

OK, Here's what I am trying to do:
   1) Allow user to Open a directory and get a list of all RTF files in that directory.
   2) Allow user to select a file from that list (Just need the file name)
   then I will process the file and display it in a RichEditBox

Can anyone help me with step 1 and 2 ? 

Eddy Van Esch

#1
Something like this, Marty?

Function TBMAIN_CMDTEST_BN_CLICKED ( _
                                   ControlIndex     As Long,  _  ' index in Control Array
                                   hWndForm         As Dword, _  ' handle of Form
                                   hWndControl      As Dword, _  ' handle of Control
                                   idButtonControl  As Long   _  ' identifier of button
                                   ) As Long

Local sCap, sFile, sDir As String
Local i As Long

sCap = "Select an RTF file"
sDir = ""
i = FF_OpenFileDialog( hWndForm, sCap, sFile, sDir, "*.rtf | *.rtf", "*.rtf", %OFN_PATHMUSTEXIST Or %OFN_EXPLORER or %OFN_ENABLESIZING, %True )

MsgBox("Selected file:" + $CrLf + sFile)
End Function
Eddy

Martin Francom

Thank's that looks like what I need !