Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

How to change location of Open Save Dialog (COMDLG32) cwith DllCall?


  • Please log in to reply
5 replies to this topic
robertcollier4
  • Members
  • 141 posts
  • Last active: Jun 28 2019 01:05 AM
  • Joined: 11 Nov 2012

I am trying to set the location of the Open Save Dialog (COMDLG32) with DllCall. So far on the forum I could only find solutions that use ControlSend - but I know that it is possible to directly change the current location via a direct DLL Call because I have seen other programs do it. Does anyone know of a code snippet that will send a DllCall to the Open Save Dialog to set its current location?



Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

I know that it is possible to directly change the current location via a direct DLL Call because I have seen other programs do it.

If you've seen how other programs do it, why do you need to ask how it's done?

 

It is very unlikely that those other programs used a "direct dll call" to set the location of the file dialog, unless of course those programs created the dialog in the first place.

 

There is a way to control the file dialog without sending keystrokes, messages or mouse clicks - it involves sending an undocumented message (WM_GETISHELLBROWSER = 0x407) to the dialog and using the IShellBrowser interface pointer which it returns.  This will completely fail with dialogs which were created by some other process.  That can be worked around by injecting code into the process which owns the dialog, but that cannot be done with AutoHotkey alone.

 

Even if those other programs used this method, it cannot be described as a "direct dll call".



robertcollier4
  • Members
  • 141 posts
  • Last active: Jun 28 2019 01:05 AM
  • Joined: 11 Nov 2012

I've seen other programs "do" it (namely Listary which is able to change the path of any Filedialogs created by any 3rd-party process),  but haven't seen the source of Listary, so don't know "how" it does it.

Thanks for the reply.



rbrtryn
  • Members
  • 1177 posts
  • Last active: Sep 11 2013 08:04 PM
  • Joined: 22 Jun 2011

Are you trying to set the initial position of a dialog you have created yourself or one in a 3rd-party app?


My Scripts are written for the latest released version of AutoHotkey.

Need a secure, accessible place to backup your stuff? Use Dropbox!


robertcollier4
  • Members
  • 141 posts
  • Last active: Jun 28 2019 01:05 AM
  • Joined: 11 Nov 2012

3rd-party app. I want to emulate the "Places Bar" with the keyboard. I want to be able to change the position of a 3rd-party Open-Save dialog after it has already been opened. For example, so I could F1-F12 to change it to specific directories. I've seen Listary do this with 3rd-party app dialogs but according to Lexikos seems this requires "injecting code into the process which owns the dialog, but that cannot be done with AutoHotkey alone". Thanks.



rbrtryn
  • Members
  • 1177 posts
  • Last active: Sep 11 2013 08:04 PM
  • Joined: 22 Jun 2011

I think there has been a misunderstanding. I thought you were talking about the screen position of the dialog window. From your last post I think you want to change which directory is displayed. You don't need a DLL call for that. The procedure for that would be:

  1. Set the text of the edit field to the directory you want to change to, e.g. c:\MyFolder. Use Control or Send for this.

  2. Send {Enter} or ControlClick the OK button

 


My Scripts are written for the latest released version of AutoHotkey.

Need a secure, accessible place to backup your stuff? Use Dropbox!