13 Jan 2008

Application Startup SignalStarted

Pour compléter mes deux articles sur comment démarrer automatiquement une application au démarrage, voici quelques explications sur la function SignalStarted. Cette fonction signale qu'une application a démarré et que son initialisation est terminée.

To complete my two posts on how to launch an application at startup, here are some explanations on the function SignalStarted. This function signals that an application has started and initialization is complete.

http://fabdecret.blogspot.com/2007/06/launch-application-at-startup.html
http://fabdecret.blogspot.com/2007/06/registry-init-key-explanations.html

Par exemple, vous avez deux applications à lancer au démarrage, et la deuxième est dépendante de la première: (toutes sont dépendantes du shell Windows).
For example, you have two applications to launch at startup and the second one is dependent on the first one: (all are dependent on the Windows shell).

Shell
Launch50 : explorer.exe
Depend50: 32 00

Application 1
Launch90 : appli1.exe

Depend90: 32 00 (Shell dependency)
Application 2
Launch100 : appli2.exe

Depend100: 32 00 5A 00 (Shell dependency and application 1 dependency)

Dans l'application 1, quand vous voulez que la seconde application soit lancée automatiquement, vous avez juste à appeler la fonction SignalStarted avec en paramètre son identifiant de séquence qui peut être récupéré dans les arguments de la WinMain à convertir en DWORD. Ensuite, l'application 2 est lancée, et si une autre est dépendante de celle-ci, il suffit de rappeler SignalStared. Si SignalStared n'est pas appelée dans l'application 1, appli2.exe qui en est dépendante ne sera jamais lancée.
Pour des détails sur cette fonction : http://msdn2.microsoft.com/en-us/library/aa450898.aspx

In the application 1, when you want the second application is automatically launched, you just have to call SignalStarted with its sequence identifier character string on the command line of the WinMain entry point converted in DWORD. Then, Application 2 is launched, if an other application depends on this one, you call SignalStared again.
If SignalStarted is not called in application
1, appli2.exe that is dependent on its launch will never run.
For details check out this:
http://msdn2.microsoft.com/en-us/library/aa450898.aspx

3 comments:

Loïc said...

Joyeux Anniversaire Fabfab,
Alors cette semaine à Grenoble, c'était sympa?
Pierre sera là lundi pour que vous fêtiez votre anniv'

Fabien Decret said...

Merci beaucoup Mr Loutre.
A lundi pour fêter ça...

Unknown said...

Nice Post... I found it while I was looking for a way to autostart my applications under windows CE.

Let's suppose I want to run two c#-coded compact framework applications (App1 and App2), and App2 depends on App1.

Do you think is it possibile to make a call to the SignalStarted function from c# ?