maqleod Posted February 14, 2009 Posted February 14, 2009 is there a way to set the filter on FileOpenDialog() to filter out what you list rather than the default? For example, I want the dialog to see all file types except .exe, .bat, .com and .pif rather than list all other possible types, can I just list those in a different manner to exclude them? [u]You can download my projects at:[/u] Pulsar Software
dantay9 Posted February 17, 2009 Posted February 17, 2009 There isn't a solution that I am aware of. You will just have to list them all or make your own gui.
maqleod Posted February 18, 2009 Author Posted February 18, 2009 There isn't a solution that I am aware of. You will just have to list them all or make your own gui.It seems to me that this should be an option for fileopendialog(), like something you can add to the filters section with the NOT keyword to exclude file types. Oh well, i suppose i could just give an error message if an executable is selected. [u]You can download my projects at:[/u] Pulsar Software
Andreik Posted February 18, 2009 Posted February 18, 2009 (edited) It seems to me that this should be an option for fileopendialog(), like something you can add to the filters section with the NOT keyword to exclude file types. Oh well, i suppose i could just give an error message if an executable is selected.It can be done something like this: Func FileOpenDialogEx($TITLE,$INIT,$EXCEPTION,$OPTIONS) Local $ERROR = False Local $FILE = FileOpenDialog($TITLE,$INIT,"All (*.*)",$OPTIONS) Local $EXT = StringRight($FILE,StringLen($FILE)-StringInStr($FILE,".",0,-1)+1) For $INDEX = 0 To UBound($EXCEPTION)-1 If $EXCEPTION[$INDEX] = $EXT Then $ERROR = True ExitLoop EndIf Next If $ERROR Then Return "EXCEPTION" Else Return $FILE EndIf EndFunc Dim $EXE[4] = [".exe",".bat",".com",".pif"] MsgBox(0,"",FileOpenDialogEx("SELECT",@ScriptDir,$EXE,1)) Edited February 18, 2009 by Andreik
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now