Sign in to follow this  
Followers 0
4Eyes

Can I reset @WorkingDir after FileOpenDialog?

8 posts in this topic

Folks,

I want to be able to select a file with FileOpenDialog() but it changes @WorkingDir to the folder holding the file as stated in the Help file. Can I prevent that or reset @WorkingDir?

I've tried @WorkingDir = @ScriptDir but that fails.

4Eyes

Share this post


Link to post
Share on other sites



Yashied,

That did it, thank you!

I was trying to call FileOpenDialog() a 2nd time pointing back to @ScriptDir, while using ControlClick or Send to 'Ok' it, but couldn't make that work.

Regards,

4Eyes

Share this post


Link to post
Share on other sites

Works fine for me.

FileOpenDialog('Select File', @WorkingDir, 'All Files (*.*)')
DllCall('kernel32.dll', 'int', 'SetCurrentDirectoryW', 'wstr', @ScriptDir)
FileOpenDialog('Select File', @WorkingDir, 'All Files (*.*)')

Share this post


Link to post
Share on other sites

Yashied,

Sorry, you misinterpreted me... I was saying that before I read your reply I was trying stupid stuff.

KaFu and you too Yashied.... I didn't even see that in the help file. Blast... I really try to not post here unless I can't work it out myself, but overlooked FileChangeDir altogether. Now wiping egg off face. Sheesh.

Regards,

4Eyes

Share this post


Link to post
Share on other sites

So many functions available, no need to excuse :). Especially if you also consider the standard UDFs, to many options to remember (and I speak from experience ;))...

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