Thursday, March 29, 2007

How do i programatically launch another application from my application

You can programatically launch another application from within your application using the SysUIAppSwitch function by passing it the sysAppLaunchCmdNormalLaunch launch code and a NULL parameter block.
Here is a code example that shows how to launch the built-in MemoPad application:


static void MainGotoApplication()

{

LocalID theDBID;

UInt theCardNo;

DmSearchStateType theSearchState;

// Grab the id of the application we want to launch (the memo pad)

DmGetNextDatabaseByTypeCreator(true, &theSearchState, sysFileTApplication, sysFileCMemo, true, &theCardNo, &theDBID);

// Launch the new app.

SysUIAppSwitch(theCardNo, theDBID, sysAppLaunchCmdNormalLaunch, NULL);

}

2 comments:

Pankaj said...
This comment has been removed by the author.
Pankaj said...

hehehe... palm ki bujha raha hai taapke.. :P
here's my blog :D
Shoot the Troubles