Hi everybody,

I'd like to launch my program at startup. So I though to use registry
and add my program but this one uses some arguments so it's not
possible by this way.
I though to create lnk into startup folder but i don't use
explorer.exe which launches programs located in startup.
So is there any way to do that without creating another program which
launch this application ???
many thanks in advance for your help.

Re: How to launch an application at startup? by Bruce

Bruce
Fri Nov 19 08:46:08 CST 2004

Two possible solutions:

1. Shortcut in the startup folder. Use .dat file to put it there.

2. Change the app to look in the registry if no command line args are
given.

--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups



Re: How to launch an application at startup? by Steve

Steve
Fri Nov 19 08:48:57 CST 2004

If your app requires arguments on the command line - then, no. You will have
to create an application that launches it or change it so it doesn't need
any arguments.

--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com
smaillet at EmbeddedFusion dot com



Re: How to launch an application at startup? by Steve

Steve
Fri Nov 19 08:53:07 CST 2004

Keep in mind that if the application is launched from the HKLM\Init key
there WILL be a command line argument! It will be a UNICODE string that you
convert to a long and pass to SignalStarted after the app has initialized.
This is how the launch from Init key dependencies work.

--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com
smaillet at EmbeddedFusion dot com



Re: How to launch an application at startup? by John

John
Fri Nov 19 14:27:08 CST 2004

There actually is an (unsupported) option that will let you do command line
options too. It also saves you from having to call SignalStarted.

Check out the code in \public\servers\sdk\samples\services\svcStart. This
is a small service in services.exe that reads executables to start at
boottime, along with a delay period (in case you want system to settle down
before starting) and cmd arguments. To build it from Platform Builder, go
to 'build OS->open release directory' and cd to this directory. Then build
and run 'sysgen -p servers svcstart.' Add svcstart.dll to your image.
You'll need this registry to get the service started:

[HKEY_LOCAL_MACHINE\Services\SVCSTART]
"Context"=dword:0
"Dll"="svcstart.dll"
"Order"=dword:99
"Keep"=dword:1
"Prefix"="STR"
"Index"=dword:0
--

Each reg subkey under this represents a different application to be started.
An example (from servers.reg) would be:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SVCStart\1]
@="msmqadm"
"Args"="register"
"Delay"=dword:4000

Check out C code if you want to know more details. This isn't doc'd in MSDN
and as I said, not officially supported. This is one of the cases where our
documentation is written in C.

--
John Spaith
Software Design Engineer, Windows CE
Microsoft Corporation

Check out the new CE Networking Team Blog at http://blogs.msdn.com/cenet/.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2003 Microsoft Corporation. All rights
reserved.

"Steve Maillet (eMVP)" <nospam1@EntelechyConsulting.com> wrote in message
news:OfuZobkzEHA.3808@tk2msftngp13.phx.gbl...
> If your app requires arguments on the command line - then, no. You will
> have to create an application that launches it or change it so it doesn't
> need any arguments.
>
> --
> Steve Maillet
> EmbeddedFusion
> www.EmbeddedFusion.com
> smaillet at EmbeddedFusion dot com
>
>



Re: How to launch an application at startup? by max_mont

max_mont
Sat Nov 20 01:55:29 CST 2004

Thanks for your response.
But what do you mean with SignalStarted ???
Is it a function I will have to implement in my app ???
In fact, I want to launch rnaapp (to start ppp connection) and I don't
want to modify the code app. And it needs some arguments.
The only way is to create app to launch rnaapp with arguments and to
put it in registry, isn't it ???
Many thanks in advance for your help.




"Steve Maillet \(eMVP\)" <nospam1@EntelechyConsulting.com> wrote in message news:<#WS19dkzEHA.1196@TK2MSFTNGP15.phx.gbl>...
> Keep in mind that if the application is launched from the HKLM\Init key
> there WILL be a command line argument! It will be a UNICODE string that you
> convert to a long and pass to SignalStarted after the app has initialized.
> This is how the launch from Init key dependencies work.

Re: How to launch an application at startup? by Bruce

Bruce
Sat Nov 20 08:51:45 CST 2004

He means that in order for an app to be used in the the HKLM\Init key, it
must call SignalStarted(). Please read about SignalStarted in the docs,
also you might want to look for this topic "Configuring the Process Boot
Phase".

Now that we know that the app which you originally referred to as "my
program" is not your program, it changes things. You should either write a
little launcher program to run from HKLM\Init or use the
undocumented/unsupported feature that John suggests.

The Launcher program could be as simple or as complicated as you need it to
be, but in it's simplest form to do what you have said you need it could be:

CreateProcess or ShellExecuteEx with hard coded app information for rnaapp
SignalStarted

If you have more time, you could have it read from the registry a list of
one or more apps to launch.

--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

"max"