Re: passing multiple parameters to an application via windows explorer
From: Craig Reynolds (craig_at_wyldphyre.com)
Date: 12/31/04
- Next message: J French: "Re: passing multiple parameters to an application via windows explorer"
- Previous message: Rob Kennedy: "Re: Canvas does not allow drawing."
- In reply to: Jamie: "Re: passing multiple parameters to an application via windows explorer"
- Next in thread: J French: "Re: passing multiple parameters to an application via windows explorer"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 31 Dec 2004 17:29:46 +0800
Jamie wrote:
> Craig Reynolds wrote:
> > Jamie wrote:
> >
> >
> >
> > Thanks for the reply Jamie, but my problem isn't working out how to
> > read the parameters from the command line, it's working out how to
> > have a single instance of my aplication launched, and have all of
> > the files it has been launched for passed into it.
> >
> > i.e. I select 4 files in windows explorer, right click on of them,
> > and select the menu item I have added. The way is currently works
> > is that the application is run for each file, and I want it to run
> > once, and have all of the selected files passed into that single
> > instance.
>
> ok, i must of missed it when i read that,
>
> the simplest way to do this is to make a stub program
> this program will be what the explorer calls, it will
> be simple with no VCL required.. just open the main
> source and create a simple windowless app that simply
> looks at the CMDLINE for its params.
> then it will use the Findwindow to search for the main
> program. if the search fails then it should start the
> main program via the createProcess, then a findWindow can be done
> again to get the window handle of the main program.
>
> when the window handle is obtained, you then can use
> the WM_COPYDATA message, this you sendMessage not postMessage
> to the window of your main app, this message will contain
> the string of your CMNLINE after you have prepared it.
> the main App should process this message and move all the string
> contents to some of its local storage because the pointer here
> will not be valid soon.
> after the sendmessage returns, the little stub program should
> terminate it self.
> P.S.
> you should give your form of the Main App a unique name so that
> findwindow does not stop of some other app that uses the same form
> name. also a unique Title Text could be used.
an interesting, and certainly plausible, idea.
I think for the moment i am going to look into making a COM server
thingy (technical term) to hook into the context menu that way, and see
if I can achieve my goal that way. If I can't them I may very well give
your idea a go.
Thanks for that.
- Next message: J French: "Re: passing multiple parameters to an application via windows explorer"
- Previous message: Rob Kennedy: "Re: Canvas does not allow drawing."
- In reply to: Jamie: "Re: passing multiple parameters to an application via windows explorer"
- Next in thread: J French: "Re: passing multiple parameters to an application via windows explorer"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|