×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Mar 2007
    Location
    Bangalore, India
    Posts
    69

    Question How to trigger the application by button click event

    Hi All,

    I have a small application and wanted to open the application by pressing 'Pencil' key when the phone is in idle mode (initial screen). Is it possible to open the application by button press event? Please guide me

    Thanks,
    Girish_VMX

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037

    Re: How to trigger the application by button click event

    Hi,

    yes it is possible. You need to capture key events on the background by e.g. some non GUI process, which will start your application then (check forum - this was discussed here many times)

    See the code snippet here:
    http://wiki.forum.nokia.com/index.ph..._thread_or_exe

    BR
    STeN

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    444

    Re: How to trigger the application by button click event

    Hi Girish,

    Search in Wiki for Key Capture.
    May this also helps.
    Using that capture the pencil key.
    Search again on how to open the particular exe or application.
    then use that code to open the exe when you have captured pencil key.

    Regards,
    Kavit.

  4. #4
    Regular Contributor
    Join Date
    Mar 2007
    Location
    Bangalore, India
    Posts
    69

    Re: How to trigger the application by button click event

    Thanks for ur kind response.
    Key capturing is fine. I wanted to open my application for key press event how do we achieve this? Please advice me

    Thanks,
    Girish_VMX

  5. #5
    Nokia Developer Champion
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037

    Re: How to trigger the application by button click event

    Hi,

    launching application is also pretty easy and there is plenty of way how to achieve this.

    Start the application:
    RApaLsSession::StartApp();

    Is it is already running, just breing them to foreground:
    TApaTask::BringToForeground();

    Check SDK, wiki or forum on how to use those methods.

    BR
    STeN

  6. #6
    Registered User
    Join Date
    Mar 2006
    Location
    India
    Posts
    503

    Re: How to trigger the application by button click event

    _LIT(KAppName, "MyApplication.exe");

    RProcess process;
    process.Create(KAppName,_L(""));
    process.Resume();
    process.Close();

    //
    TApaTaskList taskList(CEikonEnv::Static()->WsSession());
    TApaTask task = taskList.FindApp(MyUid);

    if (task.Exists())
    {
    task.BringToForeground();
    }
    else
    {
    RApaLsSession ApaLsSession;
    ApaLsSession.Connect();
    CleanupClosePushL(ApaLsSession);

    TThreadId thread;
    ApaLsSession.StartDocument(_L(""), MyUid, thread);
    CleanupStack::PopAndDestroy();
    }
    Regards
    Kamal :)
    ------------------
    You never expect what expects you.

Similar Threads

  1. What's a event based code?
    By Rafael T. in forum Symbian
    Replies: 6
    Last Post: 2009-08-18, 01:00
  2. Debugging Symbian S60 with Carbide C++ Express and NCF 1.2 Bluetooth
    By jimgilmour1 in forum Bluetooth Technology
    Replies: 4
    Last Post: 2006-09-05, 19:30
  3. Trigger event after view is Activated?
    By inc0gn1t007 in forum Symbian
    Replies: 0
    Last Post: 2006-03-29, 02:55
  4. Replies: 4
    Last Post: 2004-01-06, 10:46
  5. How to override the help button so help application not started
    By cl_jp in forum Symbian User Interface
    Replies: 1
    Last Post: 2001-12-03, 20:09

Posting Permissions

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