Roger Wallerius wrote:
Hi, the reason for doing this is that the application I want to launch is a GPS application that tracks positions in a log. But it also drains the battery, so therefore I want to have my own application to switch on and of the GPS application.My point was that you must know SOMETHING about the app, or else how do you know that it is, indeed, the app that you want to turn on/off. You say that you don't know the crID, but, lacking that, how are you going to find the app (short of looking for developer IDs at PalmSource)? If you know the name then you might be able to find the app on the device, as I'll describe below. But I can only assume that you must have a copy of this app so that you can test your code. If that is so, then just use FileZ, or something like that, to tell you what the crID is. If you don't have a copy of the app, then are you just working blind, and hoping that it will work out OK on a real device (often a tricky thing to do)?
You mentioned that :
"You could certainly look at all 'appl' type databases and assess their database names."
You would do this (off the top of my head):
Use DmGetDatabaseByTypeCreator() to iterate through all databases on the device. Set the type to 'appl' and the creatorID to NULL so that is will only find applications by ANY creator. When you have each database, use DmDatabaseInfo() to read the database name, and compare that with a string you are looking for. Problem is that the database name is not necessarily the same as the icon name, so if you only know the application name by what the icon says then you will have to look for an embedded icon string resource in the database and compare THAT to your target string. Further, if it is a localized app then you will be wanting to compare the icon name from the localized database, not the application database.
Bob.
-- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
