Sunday, 24 April 2005

How does a New submenu Command know where to create the new item?

On the command line, that’s how.

You must specify %1 in the command line somewhere, otherwise Explorer simply doesn’t do anything (it reports “Not enough storage to complete this operation”, an erroneous error message). The %1 is replaced by the full path to the file that would have been created.

Looking at Briefcase’s .bfc registry key shows that there’s also a second option passed to FormatMessage to create the command line, and it’s a number – the command line includes %2!d! which is indicative of the use of FormatMessage. It’s not clear what this second option means, however.

So that’s a step towards building our Burn Folders. Since our shell extension will be a DLL, we’ll probably include the New command as an entry point and use rundll32 to launch that. That keeps everything together.

No comments: