Get selected items of folder with WinAPI

That’s a lot of hacking to do something that is explicitly supported by the various shell objects and interfaces. Granted the documentation doesn’t make it easily discoverable, but the functionality is there. Raymond Chen wrote a great article about using these interfaces. There doesn’t appear to be a way to get the “current” folder, though I guess you could get the HWNDs and see if any is the foreground window.

Leave a Comment