The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: starzboy on February 10, 2009, 08:03:30 AM

Title: Open multiple files via contextmenu
Post by: starzboy on February 10, 2009, 08:03:30 AM
Hello
recently i had been playing with ComamndLine, and i chose to open 3-4 files with my exe via context menu integreation.
I noticed that when i use GetCommandLine, i see "path to my exe" "1st chosen file" and the rest open in differnt instances of the app.
How to make it single instance ?
now my question is how do i get the rest of the files when i had opened ?
In general how to load more than one file via context menu integeration ?

Please help
starz
Title: Re: Open multiple files via contextmenu
Post by: evlncrn8 on February 10, 2009, 11:39:37 AM
if i remember right the shell extension should be com based, and work from DragQueryFile .. etc..
not GetCommandLine
Title: Re: Open multiple files via contextmenu
Post by: Mark Jones on February 10, 2009, 02:58:05 PM
Why do you need to do this?
Title: Re: Open multiple files via contextmenu
Post by: starzboy on February 17, 2009, 02:03:58 PM
i am working on a program which will process more than one file at a time, so i need this, got any ideas bro ?
Title: Re: Open multiple files via contextmenu
Post by: BlackVortex on February 17, 2009, 02:44:10 PM
What happens when you use "Send To" ?  Supposing of course you make a shortcut of your program in your "Send To" folder ?

Hmm, or maybe your proggy can detect if there's a previous instance running and pass the filename to that and then exit.

Or you could do this in this opposite way with GetOpenFileName, which can handle multiple file selection.

EDIT: Just tested, and yes, the Send To method works as expected.
Title: Re: Open multiple files via contextmenu
Post by: japheth on February 17, 2009, 04:47:04 PM
Hi,

to make Windows explorer open only one instance of your program - to process multiple files - the program must be "DDE-aware". You can probably see examples of other programs which support this feature in your Windows registry. If there exists a "shell/open/ddeexec" key with a value such as "[open("%1")] or similar, then a running instance of this program will be notified by explorer via DDE about the arguments.