Jump to content

OPEN FILE DIALOG BUG?


jeyes56
 Share

Recommended Posts

hi, im new to the forum, but im using the autoit over a year and now i have encountered a thing that i can't figure how to deal with,

i've create program that ask the user to search for the file (open file dialog) so that the program can locate the file.

$loc = FileOpenDialog("LOCATE YOUR FILE",@DesktopDir,"All Files(*.*)")
MsgBox(0,"",$loc)

this code is working fine at a windows XP, and it returns the exact file location.

ex.

File needed : c:\new folder\my file.exe

Shortcut file: c:\documents and settings\(username)\desktop\my file.lnk

Msgbox output: c:\new folder\my file.exe

but in win7 it is not returning the exact file needed but the shortcut file itself

ex.

File needed : c:\new folder\my file.exe

Shortcut file: c:\documents and settings\(username)\desktop\my file.lnk

Msgbox output: c:\documents and settings\(username)\desktop\my file.lnk

does my code is wrong? or the program is bug? or i'm missing something about win7?

:::

I already downloaded the latest autoit installer. (12-1-2010)

Edited by jeyes56
Link to comment
Share on other sites

It works for me in Windows 7, I get the .exe file for any shortcut I click on or double click on. Same as on XP.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

oh im sorry, i posted a wrong code:

$loc = FileOpenDialog("LOCATE YOUR FILE",@DesktopDir,"All Files(*.*)")
MsgBox(0,"",$loc)

<<-- the code above is working correctly...

is should be like this

$loc = FileOpenDialog("LOCATE YOUR FILE",@DesktopDir,"(*my files*)")
MsgBox(0,"",$loc)
Link to comment
Share on other sites

oh im sorry, i posted a wrong code:

$loc = FileOpenDialog("LOCATE YOUR FILE",@DesktopDir,"All Files(*.*)")
MsgBox(0,"",$loc)

<<-- the code above is working correctly...

is should be like this

$loc = FileOpenDialog("LOCATE YOUR FILE",@DesktopDir,"(*my files*)")
MsgBox(0,"",$loc)

oh sh8, im becoming dumb, i forgot the .exe at the last,, now i fixed my program,

$loc = FileOpenDialog("LOCATE YOUR FILE",@DesktopDir,"(*my files.EXE*)")
MsgBox(0,"",$loc)

thank you for reply, and sorry for messing out here with wrong conclusion without analyzing thoroughly the situation..

::::

nothing is a bug, didn't miss anything about win7, but:

my code is wrong ^^

Edited by jeyes56
Link to comment
Share on other sites

That code doesn't work because the file filter is written wrong, it doesn't show any files just folders when I use it. Also, if the first code works correctly, then there obviously isn't a problem with the FileOpenDialog function, it must be a problem with your code. If the first code works ok, then use that instead of what you wrote in the second example.

Also, I tested it on Windows 7 Professional, and on XP Professional.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

That code doesn't work because the file filter is written wrong, it doesn't show any files just folders when I use it. Also, if the first code works correctly, then there obviously isn't a problem with the FileOpenDialog function, it must be a problem with your code. If the first code works ok, then use that instead of what you wrote in the second example.

Also, I tested it on Windows 7 Professional, and on XP Professional.

thank you for reply sit ^^

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...