×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Nov 2004
    Posts
    72

    Question Moving application in background and foreground

    Hello !
    My application works fine . But i want the process to run forever .
    So when the user presses exit i put the application to background by the following code .

    TApaTask task(iEikonEnv->WsSession());
    task.SetWgId(CEikonEnv::Static()->RootWin().Identifier());
    task.SendToBackground( );

    But my problem is when next time user opens the application , it opens well but does not close.

    What can be the solution ? I want the application to move frequently on foreground and background .

    Thanks .
    Lilesh.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167
    what do you mean by "it does not close" ?

    you mean that you can not exit it ?
    Or it does not go background in second try?

    Also check that you have derived the applications class from right base (i.e. CAkn.. for Series 60 etc.), so the system takes care not to launch dublicates of your app when user clicks the icon.

    yucca

  3. #3
    Regular Contributor
    Join Date
    Nov 2004
    Posts
    72

    Re : Moving application in background and foreground

    yucca , my problem is not yet solved .

    The application doesnt goes to background when i try it to .
    I have written the code in HandleCommandL in appUi.
    Also the appui is derived from class CAknAppUi class .
    Then what can be the problem ?

    Reply.

  4. #4
    chishti.hameed
    Guest
    here is the code which works fine for me/.

    //myApp.h

    TInt wgId;


    myAppUI.cpp
    ///////////////////
    //Background
    TApaTaskList taskList( iCoeEnv->WsSession() );
    TApaTask task( taskList.FindApp( KUidmyApp ));
    wgId = task.WgId();
    task.SendToBackground();


    //foreground
    TApaTask task( iCoeEnv->WsSession() );
    task.SetWgId( wgId );
    task.BringToForeground();

  5. #5
    Registered User
    Join Date
    Mar 2005
    Posts
    13
    Hi,

    I tried your example but I was not able to compile it because I cannot retrieve the Uid of my application. How do you define it? and how do you reference it in the AppUi class.

    I am newbie in Series 60

    Thank you in advance

  6. #6
    Registered User
    Join Date
    Oct 2004
    Posts
    19
    You can set ordinal position and ordinal priority like this:

    RWindowGroup windowGroup = CEikonEnv::Static ()->RootWin ();
    windowGroup.SetOrdinalPosition (KMaxTInt, KMaxTInt);

    Good luck,

    Roald

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×