#define appFileCreator 'cf20'
typedef struct {
UInt16 volRefNum;
Char path[256];
} OpenFile;
{
OpenFile * launchInfo;
Err error = errNone;
DmSearchStateType searchState;
UInt16 appCard;
LocalID appID;
// find the JPGview application
error = DmGetNextDatabaseByTypeCreator(true, &searchState,
sysFileTApplication, appFileCreator, true,
&appCard, &appID);
if (errNone != error) return;
// launch the application with the selected database
launchInfo = (OpenFile *)MemPtrNew(sizeof(OpenFile));
if (NULL == launchInfo) return;
MemPtrSetOwner((MemPtr)launchInfo, 0); // SysUIAppSwitch will dispose
launchInfo->volRefNum = 1;
StrCopy(launchInfo->path, "/PALM/Images/IMG.JPG");
error = SysUIAppSwitch(appCard, appID, sysAppLaunchCmdCustomBase,
launchInfo);
if (errNone != error) return;
}