Getting a list of selected items from a lister

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?

You can use dopusrt.exe for that.

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.

This is a good guide to writing this kind of shell extension and covers what I just talked about:
codeproject.com/Articles/441 ... ell-Extens

(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.)

Thanks leo, had a look at the dopusrt.exe command but missed the extra functions concerning selected items.

Should have said, I'm writing this in AutoIt - what little C I know was back when I was on the Amiga ... and it was very little.

I much preferred ARexx :wink:

I might scour the AutoIt forums though and see if it can be done using it, I might get lucky.