jeeswg wrote:One query is if it's possible to specify the (x,y) coordinates for the dialog.
Not until after it's displayed, AFAICT sorry. SHMultiFileProperties doesn't seem to offer much in the way of choice...
Btw have you looked into shell extensions much?
Not really, the standard way of writing them seems to be with C++ and ATL. I can't write C++ code to save my life and, honestly, committing seppuku seems like the more pleasing option to me. There's Delphi, too, but I don't know Pascal. C# etc. is an option but even if Raymond Chen didn't advise
against it, I despise .Net background processes anyway (a holdover from having a computer for many, many years with 128 MB RAM when the .Net framework was getting popular
).
I did find a rather good tutorial on writing a simple shell extension in C on a Windows-totally-not-a-warez-forum but I just can't think of any reason for me to even try (and probably fail).
[And I mention some other AutoHotkey requests re. shell extensions here:]
DllCall - Assign icon for “Copy/Cut/Paste/Delete” Windows default context menu items - AutoHotkey Community
Oh, IMHO, a waste of time trying that in AutoHotkey. As you note, you need to load the images in the context of the Explorer process (which, as far as I can tell, is not trivial) and even then, that's a no go for the open/save file dialogs displayed by other processes, unless you then do the same there too. And then find a good way to free the image handles in each process when done. If you write a shell extension, then the responsible component of Windows will load the extension DLL into compatible processes for you at the right time, which honestly seems easier to me.
I was mainly interested in applying an action to multiple selected files in Explorer, via the right-click context menu e.g. '7-Zip, Add to archive...'.
You probably don't need a shell extension for that. If you write a script and add it to the context menu (I think there's steps in the thread you linked to), your script will get the filenames and then from there, you can do something like (I'm not knowledgable on COM, especially shell stuff, so this might all be rubbish) create an IContextMenu representing the multiple files and from there you can invoke whatever verb on them. Mind, I don't know if that will actually work, given 7-Zip's a shell extension itself - I don't know how well it lends itself to being progmatically manipulated. I don't really know how to do it, but find Deo's Unicode x64 port of the ShellContextMenu AutoHotkey library and read Raymond Chen's posts on IContextMenu and you might be able to whip something up.
zcooler wrote:Heck yes, its going to be in a GUI, so that problem averted
It works inside the GUI
Good to hear
No multi properties dialog showing, no error or anything.
Hmm, MultiFileProperties is a
varadic function so you can actually pass it an "exploded" array as described in
Variadic Function Calls. I don't know enough about the AutoHotkey language to tell you if there's an easier way than something like this:
Code: Select all
GetFilesProperties := []
For Each, ItemID In TVSel.Selection
GetFilesProperties.Push(TVCache[ItemID, "Path"])
MultiFileProperties(GetFilesProperties*)
(untested, but unless I messed it up, I hope the gist is clear)