Sign in to follow this  
Followers 0
maqleod

FileOpenDialog() opposite filter

4 posts in this topic

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

Share this post


Link to post
Share on other sites



There isn't a solution that I am aware of. You will just have to list them all or make your own gui.


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by Andreik

When the words fail... music speaks

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0