Jump to content

Recommended Posts

Posted

The FileOpenDialog function seems to display internet shortcuts regardless of the filters used. Is this the expected behavior or a bug?

The help file example below references the desktop instead of the Windows folder since I have some internet shortcuts there.

I am running Windows 11Pro 23H2.

#include <FileConstants.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
        ; Create a constant variable in Local scope of the message to display in FileOpenDialog.
        Local Const $sMessage = "Hold down Ctrl or Shift to choose multiple files."

        ; Display an open dialog to select a list of file(s).
        Local $sFileOpenDialog = FileOpenDialog($sMessage, @DesktopDir & "\", "Images (*.jpg;*.bmp)|Videos (*.avi;*.mpg)", BitOR($FD_FILEMUSTEXIST, $FD_MULTISELECT))
        If @error Then
                ; Display the error message.
                MsgBox($MB_SYSTEMMODAL, "", "No file(s) were selected.")

                ; Change the working directory (@WorkingDir) back to the location of the script directory as FileOpenDialog sets it to the last accessed folder.
                FileChangeDir(@ScriptDir)
        Else
                ; Change the working directory (@WorkingDir) back to the location of the script directory as FileOpenDialog sets it to the last accessed folder.
                FileChangeDir(@ScriptDir)

                ; Replace instances of "|" with @CRLF in the string returned by FileOpenDialog.
                $sFileOpenDialog = StringReplace($sFileOpenDialog, "|", @CRLF)

                ; Display the list of selected files.
                MsgBox($MB_SYSTEMMODAL, "", "You chose the following files:" & @CRLF & $sFileOpenDialog)
        EndIf
EndFunc   ;==>Example

Thank you.

Posted

Testet in Win10 22H2
and it shows them to me, as well as shortcuts from folders.
maybe this is the logic, that the internet shortcut is just a location

I know that I know nothing

Posted
13 hours ago, ioa747 said:

Testet in Win10 22H2
and it shows them to me, as well as shortcuts from folders.
maybe this is the logic, that the internet shortcut is just a location

I understand folders since a file may be located in a sub-folder, but shortcuts are usually not visible in a file open dialog.

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
×
×
  • Create New...