Home All Groups Group Topic Archive Search About

Shell launch with multiple files

Author
4 Feb 2006 12:01 AM
ZipDC
Hi

I have my App associated with a file extension and I can launch a file from
explorer and parse the file using Command$ inside the App and that all works
OK.

If I highlicht a bunch of files in explorer and launch then I get separate
instances of my App.

Is there a way of getting all the files sent to the first instance of the
App?

Thanks

ZipDC

Author
4 Feb 2006 3:01 AM
Randy Birch
Have you tried modifying the registry string associated with your app to
include extra placeholders for files?  Something like:

"C:\Program Files\my prog\myapp.exe" "%1" "%2" "%3" "%4"

--

Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/

Please reply to the newsgroups so all can participate.




Show quoteHide quote
"ZipDC" <Zi***@decosson.net> wrote in message
news:ds0qt4$rv7$1$8302bc10@news.demon.co.uk...
: Hi
:
: I have my App associated with a file extension and I can launch a file
from
: explorer and parse the file using Command$ inside the App and that all
works
: OK.
:
: If I highlicht a bunch of files in explorer and launch then I get separate
: instances of my App.
:
: Is there a way of getting all the files sent to the first instance of the
: App?
:
: Thanks
:
: ZipDC
:
:
Author
4 Feb 2006 12:02 PM
ZipDC
Hi

After googling a bit I found:
http://www.vbaccelerator.com/home/VB/Code/Libraries/Shell_Projects/Registering_File_Associations/article.asp

Tried the %1 %2 method because the idea is much more elegant than the other
methods but it doesn't want to play ball on my machine!

Thanks

ZipDC

Show quoteHide quote
"Randy Birch" <rgb_removet***@mvps.org> wrote in message
news:%23QrCXdTKGHA.2696@TK2MSFTNGP14.phx.gbl...
> Have you tried modifying the registry string associated with your app to
> include extra placeholders for files?  Something like:
>
> "C:\Program Files\my prog\myapp.exe" "%1" "%2" "%3" "%4"
>
> --
>
> Randy Birch
> MS MVP Visual Basic
> http://vbnet.mvps.org/
>
> Please reply to the newsgroups so all can participate.
>
>
>
>
> "ZipDC" <Zi***@decosson.net> wrote in message
> news:ds0qt4$rv7$1$8302bc10@news.demon.co.uk...
> : Hi
> :
> : I have my App associated with a file extension and I can launch a file
> from
> : explorer and parse the file using Command$ inside the App and that all
> works
> : OK.
> :
> : If I highlicht a bunch of files in explorer and launch then I get
> separate
> : instances of my App.
> :
> : Is there a way of getting all the files sent to the first instance of
> the
> : App?
> :
> : Thanks
> :
> : ZipDC
> :
> :
>
Author
4 Feb 2006 4:17 AM
Jeff Johnson [MVP: VB]
"ZipDC" <Zi***@decosson.net> wrote in message
news:ds0qt4$rv7$1$8302bc10@news.demon.co.uk...

> I have my App associated with a file extension and I can launch a file
> from explorer and parse the file using Command$ inside the App and that
> all works OK.
>
> If I highlicht a bunch of files in explorer and launch then I get separate
> instances of my App.
>
> Is there a way of getting all the files sent to the first instance of the
> App?

Hmmm, I would guess that you'll have to use App.PrevInstance to determine if
your app is already running and then have the non-first instance of your app
talk to the first and tell it to open the file that was passed to this
current instance (and then shut itself down).
Author
4 Feb 2006 10:09 PM
ZipDC
Thanks

Did this and sent the filename using UDP to the main instance using
localhost.

ZipDC


Show quoteHide quote
"Jeff Johnson [MVP: VB]" <i.get@enough.spam> wrote in message
news:uQI2qGUKGHA.2184@TK2MSFTNGP10.phx.gbl...
>
> "ZipDC" <Zi***@decosson.net> wrote in message
> news:ds0qt4$rv7$1$8302bc10@news.demon.co.uk...
>
>> I have my App associated with a file extension and I can launch a file
>> from explorer and parse the file using Command$ inside the App and that
>> all works OK.
>>
>> If I highlicht a bunch of files in explorer and launch then I get
>> separate instances of my App.
>>
>> Is there a way of getting all the files sent to the first instance of the
>> App?
>
> Hmmm, I would guess that you'll have to use App.PrevInstance to determine
> if your app is already running and then have the non-first instance of
> your app talk to the first and tell it to open the file that was passed to
> this current instance (and then shut itself down).
>