Is it possible to get the selected items from a lister when they are not passed as arguments?
More specifically, I'm writing a program that adds a Windows Explorer context menu so I can select a load of folders bring up the context menu and execute the program. The program determines what class of window was active and if it was Explorer, it then accesses the system and retrieves an array of selected items rather than the single one that is normally passed.
I'd rather only have one context menuitem than create one for Explorer and one for DOpus.
Is it possible to retrieve a list of selected items from the active lister without them being initially passed as an argument?
However, the proper way to do it is much better and easier: Write the shell extension as a COM object and then Opus, Explorer, and everything else will pass it an IDataObject which contains a list of all the selected files. There's no need to work out which program is calling the extension or know how to get the files out of the program; there is a standard API to get the programs to pass you the list of files up-front.
(One thing the guide doesn't touch on, probably due to its age, is 64-bit, but you just need to compile & register your shell extension as a 64-bit DLL on 64-bit machines. Or as both 32-bit and 64-bit versions if you care about 32-bit apps.)