×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    102

    Identify program running in background?

    how can I avoid running two instances of my program when the user start the program again from the menu and the first one is in the background?

    I can use some sort of lock (like file) but this is risky (if the file isn't deleteed and so)

    can I stop the current run and bring the other instance to come to the foreground?

    thanks,

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Identify program running in background?

    you can detect that a application is running or not using TApaTask

  3. #3
    Nokia Developer Champion
    Join Date
    Oct 2006
    Location
    Bangalore, India
    Posts
    1,572

    Re: Identify program running in background?

    is it a gui application you are talking about. If so, then the background program itself will come to foreground automatically if open ....

    if it not a gui, then simply at the start of the non-gui exe, check if the application by its name is already running, if so, then kill myself... so the first one will keep running.
    Amit Kankani
    Nokia Developer Champion

  4. #4
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: Identify program running in background?

    Hi,

    Here is the code if kill the current running process.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  5. #5
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,168

    Re: Identify program running in background?

    If it is Gui, and you are working with S60, then make sure your application is derived from CAknApplication, then only one instance will be run when it is selected from a menu.

    However, if your application can be embedded, then there could still be multiple applications running, if one-or-more of them are embedded to another applications.

  6. #6
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    102

    Re: Identify program running in background?

    It is a gui application and derived from CAknApplication, but ..
    when I start the program again it start another instance.
    when I check the running application in the bg using long menu key I don't see my program running but I know It's there because I can bring It up with my long key sequence..



    Quote Originally Posted by amitkankani View Post
    is it a gui application you are talking about. If so, then the background program itself will come to foreground automatically if open ....

    if it not a gui, then simply at the start of the non-gui exe, check if the application by its name is already running, if so, then kill myself... so the first one will keep running.

  7. #7
    Nokia Developer Champion
    Join Date
    Oct 2006
    Location
    Bangalore, India
    Posts
    1,572

    Re: Identify program running in background?

    this sounds strange.

    what is the long key sequence you have to input ? is it read by another non-gui background exe or same application exe ?
    Amit Kankani
    Nokia Developer Champion

  8. #8
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    102

    Re: Identify program running in background?

    i found out that the problam was with these lines:

    CEikonEnv::Static()->RootWin().SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront);
    CEikonEnv::Static()->RootWin().SetOrdinalPosition(0,ECoeWinPriorityHigh);

    I use it to get ahead of the phone when displaing that an incomming call is comming. but this seems to remove the

    application from the app_dialog


    Quote Originally Posted by amitkankani View Post
    this sounds strange.

    what is the long key sequence you have to input ? is it read by another non-gui background exe or same application exe ?

  9. #9
    Nokia Developer Champion
    Join Date
    Oct 2006
    Location
    Bangalore, India
    Posts
    1,572

    Re: Identify program running in background?

    so now is your problem solved ? if not what is the exact problem now ?
    Amit Kankani
    Nokia Developer Champion

Similar Threads

  1. Replies: 1
    Last Post: 2008-04-24, 14:23
  2. Keeping a Program running at all times
    By -chris- in forum Symbian
    Replies: 2
    Last Post: 2008-04-07, 03:45
  3. background running application
    By ghjkfor in forum Symbian
    Replies: 3
    Last Post: 2008-02-05, 20:22
  4. knowing-if an application is running in background
    By sunny_singh in forum Symbian
    Replies: 3
    Last Post: 2005-11-21, 12:01
  5. Replies: 1
    Last Post: 2005-08-29, 04:18

Posting Permissions

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