Who started me?



I have a "Launcher" application that does version checking. It will
copy a newer version from the server if needed, and then start the
main application. I believe Tony Toews "Auto FE Updater" serves a
similar purpose. My app calls ShellExecute to run the command line
specified in a "Launcher.ini" file. A typical command line may be:
AppCommandLine="C:\Program Files\Microsoft
Office2003\OFFICE11\MSACCESS.EXE" C:\Test\Test.mde
This all works fine. The path to MsAccess is typically there because
my users often have more than one version installed.

Now I want to know if my application was started by Launcher, or by
some other way. I would then refuse to run. My first idea was to add:
/x LaunchedByLauncher
to the command line. This macro would call a function that would set a
global variable, which I could test for in my startup code.
Alas, /x runs too late: the AutoExec macro runs first, then the /x
macro runs.

So I'm open to suggestions. How can I know who started me?

One thought is to keep Launcher.exe running a bit longer (currently it
is start-and-terminate), and then call FindWindow to see if it is
running. Seems like a cumbersome process and technically I would not
be 100% sure that instance of Launcher started Me.

Thanks,

-Tom.

.



Relevant Pages

  • Re: Who started me?
    ... My app calls ShellExecute to run the command line ... Now I want to know if my application was started by Launcher, ... the AutoExec macro runs first, then the /x ... Maybe create the existence of a file when something is launched...or with a particular name. ...
    (comp.databases.ms-access)
  • Re: PATH ~/bin under gnome
    ... not on the gnome environment. ... Right - ~/.bashrc works when you call stuff from the command line. ... you want to run a script that has a graphical front end (using ... If, on the other hand, you want to use a GNOME menu item or panel launcher ...
    (Ubuntu)
  • Re: Who started me?
    ... My app calls ShellExecute to run the command line ... Now I want to know if my application was started by Launcher, ... the AutoExec macro runs first, then the /x ... MsgBox "Not launched by launcher", ...
    (comp.databases.ms-access)
  • Re: Who started me?
    ... My app calls ShellExecute to run the command line ... Now I want to know if my application was started by Launcher, ... the AutoExec macro runs first, then the /x ... MsgBox "Not launched by launcher", ...
    (comp.databases.ms-access)
  • Re: Signature of main
    ... say) and then invoke a method of that instance. ... represent the external environment /within/ the world of objects. ... think that the launcher "should" create an instance of a nominated class, ... So the launcher command line would look ...
    (comp.lang.java.programmer)