I want to to launch 'Network Preferences' panel from my application when the
user hits a button.  How do I do this?

I tried the code below but something is definitely wrong with this.  What is
wrong with this code? 

(i) I am also not sure how to specify to go to the right prefrences panel as
there are multiple-preferences panels)
(ii) I am also not sure whether I should use SysAppLaunch or SysUIAppSwitch
in this case.

Thanks - Srinivas

Launch(sysFileTApplication, 'pref',  sysAppLaunchCmdPanelCalledFromApp,
NULL, false);

where the function Launch is defined as:

Err Launch(UInt32 type, UInt32 creator, UInt16 launchCode,
                   void *param, Boolean sub)
{
        DmSearchStateType       searchState;
        UInt16                          cardNo;
        LocalID                         dbID;
        Err                             err;
        UInt32                          result;

        // look for the app
        err = DmGetNextDatabaseByTypeCreator(true, &searchState, type,
        
creator, true,  &cardNo, &dbID);

        if (err == 0) {
                if (dbID) {
                        // launch the app
                        if (sub)
                                err = SysAppLaunch(cardNo, dbID, 0,
launchCode, (char *)param, &result);
                        else
                                err = SysUIAppSwitch(cardNo, dbID,
launchCode, (char *)param);
                } else {
                        err = -1;
                }
        }
        return err;
}


- Srinivas

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to