Here's a fancier version. Single click in the browse window to get to your location then double click on the desired location. Files in the double clicked folder should display in the list box on the right. Use the mouse with ctrl and shift to select multiple files. Pick the "process" button to work with the selection.
Code: Select all
OnEvent>Key_Down,VK1,0,Click
Let>ClickFlag=0
Let>DataCount=0
Let>strFolderName=C:\
Dialog>Dialog5
object Dialog5: TForm
AutoSize = True
BorderStyle = bsNone
FormStyle = fsStayOnTop
object MSImage1: tMSImage
AutoSize = True
end
end
EndDialog>Dialog5
Dialog>Dialog1
object Dialog1: TForm
Caption = 'Select'
ClientHeight = 470
ClientWidth = 1099
Position = poScreenCenter
object PButton: tMSButton
Left = 1014
Top = 445
Width = 75
Height = 21
Caption = 'Process'
end
object Edit1: TEdit
Left = 332
Top = 4
Width = 680
Height = 21
end
object MSListBox1: tMSListBox
Left = 332
Top = 25
Width = 680
Height = 441
end
end
EndDialog>Dialog1
GoSub>MakeBrowserDialog
AddDialogHandler>Dialog1,PButton,OnClick,Process
AddDialogHandler>Dialog1,,OnClose,Quit
Show>Dialog1
Label>Loop
Wait>0.01
If>ClickFlag>0
Add>ClickFlag,1
If>ClickFlag>10
Let>ClickFlag=0
DeleteFile>%temp_dir%BrowserDialog.txt
EndIf
EndIf
Goto>Loop
SRT>Quit
Exit>0
END>Quit
SRT>Click
Let>WIN_USEHANDLE=1
GetActiveWindow>title,winx,winY
If>Title=ExpTitle
If>ClickFlag>3
SetFocus>ExpTitle
Wait>0.1
Let>WIN_USEHANDLE=0
Press Enter
Label>WaitForFile
IfFileExists>%temp_dir%BrowserDialog.txt
ReadLn>%temp_dir%BrowserDialog.txt,1,strFolderName
GoSub>Populate
GoSub>MakeBrowserDialog
Else
Wait>0.1
Goto>WaitForFile
EndIf
EndIf
EndIf
Let>WIN_USEHANDLE=0
Let>ClickFlag=1
END>Click
SRT>Populate
SetDialogProperty>Dialog1,MSListBox1,MultiSelect,True
SetDialogProperty>Dialog1,Edit1,Text,strFolderName
GetFileList>%strFolderName%\*.*,strFileList,CRLF
StringReplace>strFileList,%strFolderName%\,,strFileList
SetDialogProperty>Dialog1,MSListBox1,Text,strFileList
END>Populate
/*
BrowserDialog:
Dialog>Browse%dataCount%
object Browse%dataCount%: TForm Left = 0 Top = 0
object MSButton1: tMSButton end end
EndDialog>Browse%dataCount%
SetDialogProperty>Browse%dataCount%,MSButton1,InitialDir,%strFolderName%
SetDialogProperty>Browse%dataCount%,MSButton1,BrowseStyle,fbFolder
SetDialogProperty>Browse%dataCount%,MSButton1,DoBrowse,True
GetDialogProperty>Browse%dataCount%,MSButton1,Filename,strFoldName
WriteLn>%temp_dir%BrowserDialog.txt,wres,strFoldName
//DeleteFile>%temp_dir%BrowserDialog.scp
*/
SRT>MakeBrowserDialog
IfFileExists>%temp_dir%BrowserDialog.txt
DeleteFile>%temp_dir%BrowserDialog.txt
EndIf
IfFileExists>%temp_dir%BrowserDialog.scp
DeleteFile>%temp_dir%BrowserDialog.scp
EndIf
Add>DataCount,1
LabelToVar>BrowserDialog,vData%dataCount%
WriteLn>%temp_dir%BrowserDialog.scp,wres,vData%dataCount%
Wait>0.1
ExecuteFile>%temp_dir%BrowserDialog.scp
Let>BFF_count=0
Let>ExpTitle=none
Label>WaitBFF
LibFunc>user32,SetParent,SPres,ExpTitle,DIALOG1.HANDLE
Let>WIN_USEHANDLE=1
GetWindowHandle>Browse For Folder,ExpTitle
If>ExpTitle<>none
Else
Goto>WaitBFF
EndIf
LibFunc>user32,SetParent,SPres,ExpTitle,DIALOG1.HANDLE
Wait>0.1
MoveWindow>ExpTitle,-10,-77
ResizeWindow>ExpTitle,240,590
Let>WIN_USEHANDLE=0
CloseDialog>Dialog5
END>MakeBrowserDialog
SRT>Process
GetDialogProperty>Dialog1,MSListBox1,SelectedItems,strFiles
Let>MSG_WIDTH=600
Let>MSG_HEIGHT=400
MDL>Selected Folder:%CRLF%%strFolderName%\%CRLF%%CRLF%Selected Files:%CRLF%%strFiles%
END>Process