×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Jan 2013
    Posts
    8

    Question How to get handle to power key menu

    Hi guys
    I want change the menu what shows when you press the power button key on the phone
    I already know the API to alter the menu, but I need a handle to work
    Thank you

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

    Re: How to get handle to power key menu

    What API are you using and how ?

    What excatly would you assume that should happen when you use the API, and what are you experiencing happining instead ?

  3. #3
    Registered User
    Join Date
    Jan 2013
    Posts
    8

    Re: How to get handle to power key menu

    I found this example in the symbian API help
    Code:
    void CMyappView::DynInitMenuPaneL( TInt aResourceId,
                                       CEikMenuPane* aMenuPane )
    {
      if ( aResourceId == R_COMMON_MENU )
      {
    
        CEikMenuPaneItem::SData menuFindNext;
    
        menuFindNext.iCommandId = EMyappFindNext;
    
        menuFindNext.iCascadeId = 0;
    
        menuFindNext.iFlags = 0;
    
        menuFindNext.iText = KMyappFindNext;
    
        aMenuPane->AddMenuItemL( menuFindNext );
    
      }
    }
    I need a pointer CEikMenuPane to the menu show in the power button click

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

    Re: How to get handle to power key menu

    that would work in general menu handling insaide your own application, I would not think that it would be fired when the power key is pressed outside your own application contex.

    or have you verified that this function gets called when the power key is pressed ?

  5. #5
    Registered User
    Join Date
    Jan 2013
    Posts
    8

    Re: How to get handle to power key menu

    No
    This function is to add a item to a menu
    When the user press the power button one menu appears
    So I need a handle to this menu to use my function to add another item
    I believe this menu is created when the system starts e exists while the power is on
    So I want to add a item in this menu when my app starts.
    Thx

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,697

    Re: How to get handle to power key menu

    You can track focus changes via implementing AppUi::HandleForegroundEventL. If you check it, you will see that the menu in question is provided by a completely different application. DynInitMenuPaneL in your application can not change it.

  7. #7
    Registered User
    Join Date
    Jan 2013
    Posts
    8

    Re: How to get handle to power key menu

    Quote Originally Posted by wizard_hu_ View Post
    You can track focus changes via implementing AppUi::HandleForegroundEventL. If you check it, you will see that the menu in question is provided by a completely different application. DynInitMenuPaneL in your application can not change it.
    So there is no way to change it?
    I know have some cfw who change this menu, I believe it is some kind of resource file in file system
    Maybe is possible to read the menu structure, copy it and replace the power button behavior?

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

    Re: How to get handle to power key menu

    What it is excatly that you would want to do with it ?

    Generally only way to 'modify' it what I could quickly think, would be to actually capture the power key, and then to bring your own 'menu' on top, i.e. actually replacing the menu, this would of course mean that you would need to implement all functionality included in teh menu by yourself, or use key-simulation (or by disabling the key capturing) to bring the menu back when needed.

    All and all, would not recomend doign so, unless you are certain you know what you are doing there.

  9. #9
    Registered User
    Join Date
    Jan 2013
    Posts
    8

    Re: How to get handle to power key menu

    I want add some functionality to power menu, maybe to the shell menu too.
    I don't want wanna need open a app to do some stuff.
    Just hit power button, select option and done.
    The replace option is OK, as long I can read the stock menu structure to replace it.
    The problem with this option is sometimes the menu change, like when you have or not the energy save profile active.

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

    Re: How to get handle to power key menu

    Quote Originally Posted by leodinei View Post
    I want add some functionality to power menu, maybe to the shell menu too.
    I don't want wanna need open a app to do some stuff.
    Just hit power button, select option and done.
    The replace option is OK, as long I can read the stock menu structure to replace it.
    The problem with this option is sometimes the menu change, like when you have or not the energy save profile active.
    AFAIK there is no API to do these, so you might want to reconsider your requirements and the need for them.

  11. #11
    Registered User
    Join Date
    Jan 2013
    Posts
    8

    Re: How to get handle to power key menu

    OK
    I will search a little more on this topic.
    A mod can close the topic.
    Thx for the help.

Similar Threads

  1. how to handle opeion menu in form ?
    By nokia_lin in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-04-15, 12:39
  2. How to handle Pop up menu items
    By ssabestian in forum Symbian
    Replies: 3
    Last Post: 2009-02-20, 10:45
  3. How Can I Handle The Menu Screen.
    By ashutosh12 in forum Symbian
    Replies: 5
    Last Post: 2007-06-18, 06:56
  4. How to handle order of option menu
    By magovoru in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-11-09, 13:57
  5. Handle menu with application in background
    By jrgm223 in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-05-31, 10:40

Posting Permissions

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