Re: Communication Between Programs

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Sten Westerback (sten.westerback_at_NO_SPAMnokia.com)
Date: 07/09/04


Date: Fri, 09 Jul 2004 09:00:14 GMT


"Orlando Gondar" <GELECTRONICS@HOTMAIL.COM> wrote in message
news:OGVm8NrYEHA.1264@TK2MSFTNGP11.phx.gbl...
> "Stefan Kuhr" <kustt110@gmx.li> wrote in message
> news:40E93A30.D0E1421@gmx.li...
> > Hello Orlando,
> >
> > Orlando Gondar wrote:
> > >
> > > You know any page, topic or examplem, that's one thing you dont find
> much
> > > info.
> > >
> > > I will like to write a example and save it as reference.
> > >
> >
> > You must be kidding, right? Have you bothered searching Google or MSDN
> > for ShellExecute samples? There are more than plenty of them.
> >
> > --
> > Stefan
> Stefan, most of those examples are about how to use the ShellExecute
> function.
> No details on the server or client, that is one program send the function,
> the other
> respond to it, the last is what I am looking for. Not how to call any
> program with ShellExecute.

If you don't like the ease of STARTING (not calling) ShellExecute then
you can find out what it does. It uses CreateProcess() either with a
specific command line parameter or without one. In the latter case the
system usually uses DDE to send a request to the handler application.
To find out what to do ShellExecute() looks under HKEY_CLASSES_ROOT:
1. check for file type (.xxx) key... or for an "Content Type" value under
one of
    them (if the command line is an URL).
2. Find out the value of the unnamed ("(default)") variable
        Example: .doc --> Word.Document.8
3. Open "Word.Document.8\shell\Open" key and then
    look at "command" subkey for command line info and
    "ddeexec" subkey, when present, for DDE parameter info.
4. Create CreateProcess() structure and start it...

- Sten


Quantcast