Home » C# ProgrammingRSS

Autorun application on Windows Mobile

Hi. I have an application that requires to autorun when the phone is first powered on. I'm using windows mobile 6.0 on 3.5 .netCF. I not sure where to start. Please help. Thanks.

 

3 Answers Found

 

Answer 1

You can add your application  in the [HKLM\Init] registry to auto launch your application while the device boots.

[HKLM\Init]

"Launch90"="Myapp.exe"

"Depend90"=hex:1e,00 ; depend on GWES, which is at 30

FOr more details on these registry keys check out this link

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

Sometimes auto launching .netCF application will not work,for that solution is there on the following link.

http://blog.opennetcf.com/ctacke/2009/04/15/AutolaunchingCFAppsWithTheHKLMInitRegistryKey.aspx

 

--
Regards,
Prabu
http://prabukumar.wordpress.com/
www.e-consystems.com
 

Answer 2

Hi Cosmer,

You can do this either as Prabhu has mentioned by setting the dependency under HKEY_LOCAL_MACHINE\Init in registries of your mobile  device and in this approach you have to use "SignalStarted(DWORD)"

refer this for the above approach

http://www.codeproject.com/KB/windows/WiMoAutostart.aspx

 

Or

You may do this also by creating shortcut (lnk file) under "start up" folder of your mobile device.



        [DllImport("coredll.dll", EntryPoint = "SHCreateShortcut", SetLastError = true)]
        public static extern bool SHCreateShortcut(string shortcut, string target);

SHCreateShortcut(@"\Windows\StartUp\XYZ.lnk", "\"" + "Program Files\\ABC\\XYZ.exe" + "\"");

 

Regards,

Rahul Jaiswal


Please remember to mark the replies as answers if they help  and unmark them if they provide no help

 

 

 

 

Answer 3

It is because of the reason that you have not declared any return type for the method under which you called this API.

Do it like this

 

[DllImport("coredll.dll", EntryPoint = "SHCreateShortcut", SetLastError = true)]
        public static extern bool SHCreateShortcut(string shortcut, string target);

//Any menu press event

private void menuItemAutoStart_Click(object sender, EventArgs e)
{

SHCreateShortcut(@"\Windows\StartUp\XYZ.lnk", "\"" + "Program Files\\ABC\\XYZ.exe" + "\"");

}

 

Regards,

Rahul Jaiswal


Please remember to mark the replies as answers if they help  and unmark them if they provide no help
 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter