×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    192

    Question Runing the application in background

    Hi everyone,

    I have almost finish my application, i still need a "hide" button, in order to run the application in background.
    Any help concerning this issue ?

    Thank you
    Best Regards,

  2. #2
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    95

    Re: Runing the application in background

    Have you tryed to call hide() method of your QMainWindow object?

  3. #3
    Registered User
    Join Date
    Jan 2011
    Posts
    192

    Re: Runing the application in background

    Quote Originally Posted by negus View Post
    Have you tryed to call hide() method of your QMainWindow object?
    yes i tried the hide() method, but it always hide to me all the widgets in the application. and that's not what i need, i need to hide all the application ( like minimize it )

  4. #4
    Registered User
    Join Date
    Jan 2009
    Posts
    172

    Re: Runing the application in background

    http://wiki.forum.nokia.com/index.ph..._to_background


    try :
    RWindowGroup* wg = &CCoeEnv::Static()->RootWin();
    wg->SetOrdinalPosition(-1);


    libs add -lws32 and -lcone


    Regrds
    Wae

  5. #5
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    95

    Re: Runing the application in background

    You can simulate "red key" click.

  6. #6
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Runing the application in background

    Code:
    	// Construct en empty TApaTask object
    	// giving it a reference to the Window Server session
    	TApaTask task(mVreeEikonEnv->WsSession( ));
    				
    	// Initialise the object with the window group id of 
    	// our application (so that it represent our app)
    	task.SetWgId(mVreeEikonEnv->RootWin().Identifier());
    	
    	// Request window server to bring our application to foreground or send to background.
    	if(bFlag)
    	{
    		task.BringToForeground();
    	}
    	else
    	{
    		task.SendToBackground();
    	}

  7. #7
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Runing the application in background

    yes danhick is correct you need to use native symbian APIs for that.

    and a call to hide will just hide the widget not the whole application.

    Regards,

  8. #8
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    51

    Re: Runing the application in background

    Hi, I also need to run my app in background

    Searching the forum found this way to Qt:

    .pro:

    symbian {
    LIBS += -lcone -lws32
    }

    CODE:

    CCoeEnv::Static()->RootWin().SetOrdinalPosition(-1); // This line fail.


    But I do not recognize CCoeEnv compile.

    Do I have to include something else?

    Using Qt Nokia SDK, which comes with qt creator.

    Thanks

  9. #9
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Runing the application in background

    Yep, you need an include or two or three.

  10. #10
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    51

    Re: Runing the application in background

    Quote Originally Posted by danhicksbyron View Post
    Yep, you need an include or two or three.
    What I have to include?

    Thanks

  11. #11
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Runing the application in background


  12. #12
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    51

    Re: Runing the application in background

    Quote Originally Posted by danhicksbyron View Post
    I include #include <coemain.h> // CCoeEnv

    But when compiling I get the message:

    - undefined reference to 'CCoeEnv::Static()'
    - undefined reference to 'RWindowTreeNode::SetOrdinalPosition(int)'

    My code is very simple:

    #include <QtGui/QApplication>
    #include "mainwindow.h"
    #include <coemain.h> // CCoeEnv
    #include <coedef.h>
    #include <eikenv.h>
    #include <aknquerydialog.h>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;



    #if defined(Q_WS_S60)
    w.showMaximized();
    #else
    w.show();
    #endif

    RWindowGroup* wg = &CCoeEnv::Static()->RootWin();
    wg->SetOrdinalPosition(-1);

    return a.exec();
    }

    Thanks

  13. #13
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Runing the application in background

    Did you notice the point about including the libraries?

Similar Threads

  1. J2ME aplication runing in background
    By frco.marin in forum Mobile Java General
    Replies: 9
    Last Post: 2010-11-16, 21:46
  2. Replies: 2
    Last Post: 2009-02-03, 13:28
  3. Application not runing in background
    By sriramadasu in forum Symbian
    Replies: 7
    Last Post: 2008-10-06, 10:55
  4. Replies: 6
    Last Post: 2006-10-27, 08:54
  5. Show message while the Application runing on background
    By cindul in forum Symbian User Interface
    Replies: 1
    Last Post: 2005-05-17, 07:57

Posting Permissions

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