Jump to content

Problem with FileSelectFolder under Win 7/8


Recommended Posts

Hi!

I have a strange problem with FileSelectFolder under Windows 7 and 8. What happens:

- I call the function and the dialog opens: $folder = FileSelectFolder("Please choose new folder:", $basepath, 3, "", $form)

- I click on the "create new folder" button on the lower left side

- a new folder shows up with default name

- I change the folder name immediately

- I press enter, but the dialog doesn't show the CHANGED folder name, but the default one (but in the background the folder is created with the name I entered!!)

If I click ok now, it says folder doesn't exist (that's ok, because it still searches for a folder with the default name) but if I cancel and re-open the dialog, it correctly shows the folder name I entered before and I can select it. The dialog simply isn't refreshed after creating and renaming the new folder.

This doesn't happen under Win XP, but Win 7, 8 regardless of 32 or 64 bit.

Am I doing something wrong or could this be a bug?

Regards,

Holger

Edited by pandel
Link to comment
Share on other sites

I would post what you tried. Or a small reproducer.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Arg! Didn't follow my own topic and so I have not seen your replies... Many thanks!

The problem is that it doesn't happen only on my computer. The code is inside a tool I wrote, and this tool is used by a whole lot of people. Many of them told me, that they noticed exactly the same wrong behaviour.

My code:

$project_folder = FileSelectFolder(__("Please choose new project folder:"), $opsi_dev_dir, 3, "", $form)

$opsi_dev_dir is a simple network path, like "w:develop".

@abberration: thanks for the article. I'll try some of the suggestions mentioned there when I'm back home again. My computer at work is XP, so no problem here.

Link to comment
Share on other sites

  • 2 weeks later...

Does every computer you're using it on have a "W:" drive that points to that same share location?

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

No. It is user configurable. In my app I have a settings dialog where you can set the base folder to whatever drive and subfolder you like and then FileSelectFolder starts from there.

Post your code, because you're just confusing everyone with the answers you're giving.

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

???

You asked, if there is always a drive "W:" and I said, "No", sometimes it is "W:", sometimes "Z:" or whatever, it really doesn't matter! The drive ALWAYS exists, because I check it before I open the FileSelectDialog, and that's all.

What is so confusing about it?

The important code line is in #5...

Edited by pandel
Link to comment
Share on other sites

What exactly does the __() function do?

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

I did some tests using SciTe and only one single line of code, first on a local drive, second on a network drive:

1st)

line of code: $bla = FileSelectFolder("test","C:",3)

Everything works as expected. If I create a new folder from within the dialog, the new folder name is shown immediately after typing the new name and pressing ENTER.

2nd)

- assign network drive from Samba server: net use z: servershare

- line of code: $bla = FileSelectFolder("test","Z:",3)

When I create a new folder, I can still change the name and when I press ENTER the new folder is created with the new name (verified with windows explorer), BUT the new name isn't shown in the dialog. It still says "New folder".

Win 8, 64 bit.

Link to comment
Share on other sites

2nd)

- assign network drive from Samba server: net use z: servershare

- line of code: $bla = FileSelectFolder("test","Z:",3)

When I create a new folder, I can still change the name and when I press ENTER the new folder is created with the new name (verified with windows explorer), BUT the new name isn't shown in the dialog. It still says "New folder".

 

Any non-Samba shares you can test it on?

Link to comment
Share on other sites

For some reason this "$bla = FileSelectFolder("test","z:",3)" was working fine on my work computer (Win7 x64), but wasn't working on my home computer, same OS.

Now I test it this morning (on my work computer) and I'm getting the same issue the OP is getting, I create a new folder and rename it, hit Enter and the folder name (in the dialog) still shows New Folder and $bla is set to "New Folder" as well. If I go to the drive in question, it shows the folder with the new name.

Although I'm not sure if it's an issue with the Windows file select dialog or with AutoIt because I can't for the life of me figure out how to invoke that dialog from something like VBScript.

Edited by BrewManNH

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

For some reason this "$bla = FileSelectFolder("test","z:",3)" was working fine on my work computer (Win7 x64), but wasn't working on my home computer, same OS.

Now I test it this morning (on my work computer) and I'm getting the same issue the OP is getting, I create a new folder and rename it, hit Enter and the folder name (in the dialog) still shows New Folder and $bla is set to "New Folder" as well. If I go to the drive in question, it shows the folder with the new name.

Although I'm not sure if it's an issue with the Windows file select dialog or with AutoIt because I can't for the life of me figure out how to invoke that dialog from something like VBScript.

Just tried it myself, same issue. Win7 32-bit on a Server 2008 R2(x64) share.

Link to comment
Share on other sites

Phew! I'm not alone. That doesn't solve the problem, but it makes me feel a bit better :bye:

Does anybody have access to AutoIt source code? I think it could have something to do with SHBrowseForFolder (http://msdn.microsoft.com/en-us/library/windows/desktop/bb762115%28v=vs.85%29.aspx), if it is used for FileSelectFolder...

@BewManNH

regarding VBScript

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(0, "Example", 1, "c:\Programme")
If objFolder Is Nothing Then
    Wscript.Quit
End If
wscript.Echo "folder: " & objFolder.title & " Path: " & objFolder.self.path
Edited by pandel
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...