views:

242

answers:

2

How can I automatically run my C# program after hard-reset or soft-reset on Windows CE?

+1  A: 

in your applications .reg file, add the following:

[HKEY_LOCAL_MACHINE\init] "Launch50"="PlatformStartup.exe" "Depend50"=hex:14,00,1E,00

Source - http://msdn.microsoft.com/en-us/library/aa446914.aspx

Hope that helps!

FailBoy
Except that this will fail for a C# app. http://blog.opennetcf.com/ctacke/2009/04/15/AutolaunchingCFAppsWithTheHKLMInitRegistryKey.aspx
ctacke
And you have it depending on the entries at 20 and 30, yet you don't know what those entries are. Again a bad, or at least incomplete, recommendation
ctacke
Oh, and launching this way requires that your app calls the SignalStarted API with the index passed in to you. I doubt his app does that, so anything after entry 50 will never get launched.
ctacke
A: 

[HKEY_LOCAL_MACHINE\init] will not launch your C# app! You should read that article Chris Tacke gave link to.

There is also some ready solutions like AutoLaunch, that you can include in your OS image as a subproject. If you choose this solution, make sure that you have the APIs it is waiting for (check IsNetworkReady()) or it will hang there forever.

Eugene Kulabuhov