A program on a memory card runs as soon as the card is inserted.A program can be automatically started in one of four ways: When I use the phrase auto-start, I use it to refer to the launching of any program based on an event (other than the user clicking on the program’s icon). Remember that on Windows Mobile devices, you should prevent more than one instance of your program from existing in memory (if a second instance is started, it should notify the first instance and then immediately terminate). To run the code examples, you will need a Windows Mobile device (or emulator) and Visual Studio 2008. Additionally, Win32 also contains a structure and an enumeration needed to properly pass information to the WinAPI functions. Both code examples refer to a project named Win32 which contains the references to these functions. The code examples rely on some Win32 functions that are called through P/Invoke. For these methods, I have included example code within the article, and full source attached to the article. Later within this article, I discuss methods for automatically launching applications that are setup through code. For these methods, I do not provide code examples. The first methods of automatically starting a program are centered in what I will call configuration tasks making shortcuts, Registry entries, or placing files in specific locations. It's possible to achieve similar functionality by making your own executable that watches system changes through the SystemState class and responding accordingly, but that would cause your program to have a larger footprint. The information presented here was tested on Windows Mobile 5 and Windows Mobile 6 devices, but can also be applied to several versions of Windows CE (the OS from which Windows Mobile is derived). During my research, I placed all of my notes in various documents, and have decided to organize them into a single document and share with all. The information was scattered, and a bit of research was needed to collect all of it. ![]() Figuring out how to make an application automatically start up had long been a mystery to me.
0 Comments
Leave a Reply. |