×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Registered User
    Join Date
    Jul 2009
    Posts
    20

    Hide/Show My App and Getting Key Like #123...

    Hi, I could hide my application by this codeSymbian C++ s6)


    CEikonEnv::Static()->RootWin().EnableReceiptOfFocus(EFalse);
    CEikonEnv::Static()->RootWin().SetOrdinalPosition(-1000, ECoeWinPriorityNeverAtFront);


    Now, I do not know how can I show it again, because the Symbian focus is located on another app after Set Ordinal.
    Could you please help me for finding a solution?
    it is important to me that my app appears with a specific code like #123 ...
    If you know better way I would appreciate help me.

    Thanks

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

    Re: Hide/Show My App and Getting Key Like #123...

    try searching for threads talking about CaptureKey, or check wiki for exmaples. Then when you capture the key, just use the SetOrdinalPosition to bring your app back to teh front(that also should have wiki exmaple, as well as loads of old discussion threads).

  3. #3
    Registered User
    Join Date
    Jul 2009
    Posts
    20

    Re: Hide/Show My App and Getting Key Like #123...

    Thanks for your reply.

    I have just found a class as you can check here:

    " http://wiki.forum.nokia.com/index.ph...ui_application "

    Then I have added this class to my app as CKeyCapture class and when I am writing this code :

    CKeyCapture* MyKey = new CKeyCapture;

    in MyAppUi::ConstructorL()

    I have an error like "Error : CKeyCapture :no appropriate default constructor available "
    Could you please help me for getting the point. ?

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

    Re: Hide/Show My App and Getting Key Like #123...

    try it like:

    CKeyCapture* MyKey = new(ELeave)CKeyCapture();

  5. #5
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: Hide/Show My App and Getting Key Like #123...

    Try to do like this:

    in MyAppUi.h
    Code:
    class CCapKey2AppUi : public CAknAppUi, MKeyCallBack 
        {
        ...
        ...
        private:
           CKeyCapture* iMyKey;
        ...
        }
    in MyAppUi.h cpp in MyAppUi::ConstructorL()
    Code:
    iMyKey = CKeyCapture::NewL( this );

  6. #6
    Registered User
    Join Date
    Jul 2009
    Posts
    20

    Re: Hide/Show My App and Getting Key Like #123...

    Thanks for your reply.

    it does not work, and shows me some errors like :

    error C2065: 'iMyKey' : undeclared identifier
    \SRC\MYappui.cpp(79) : error C2664: 'NewL' : cannot convert parameter 1 from 'class MYAppUi *const ' to 'class MKeyCallBack &'

    Thanks,

  7. #7
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: Hide/Show My App and Getting Key Like #123...

    Are you sure that you have already declared iMyKey in the header file?

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

    Re: Hide/Show My App and Getting Key Like #123...

    also your appui is not derived from MKeyCallBack

  9. #9
    Registered User
    Join Date
    Jul 2009
    Posts
    20

    Re: Hide/Show My App and Getting Key Like #123...

    Yes, but I have this one as well:

    "Error : Can not parameter 1 from class CCapKey2AppUI *const to class MKCallBack&"

    Thanks,
    Arvin

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

    Re: Hide/Show My App and Getting Key Like #123...

    consider reading #8

  11. #11
    Registered User
    Join Date
    Jul 2009
    Posts
    20

    Re: Hide/Show My App and Getting Key Like #123...

    I have just added

    In MyAppUi.h

    class CKeyCapture;

    class CCapKey2AppUi : public CAknAppUi, MKeyCallBack
    {
    public:

    void ConstructL();

    protected:

    private:

    CKeyCapture* iMyKey;

    };


    in MyAppUi.cpp file

    void CCapKey2AppUi::ConstructL()
    {
    iMyKey = CKeyCapturer::NewL(this);
    }


    but I have the error that I was saying to you.

    Thanks
    Arvin

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

    Re: Hide/Show My App and Getting Key Like #123...

    try like this iMyKey = CKeyCapture::NewL( *this );

  13. #13
    Registered User
    Join Date
    Jul 2009
    Posts
    20

    Re: Hide/Show My App and Getting Key Like #123...

    It does not work and it gives me :

    error " C2440 :'=' cannot convert from class CKeyCapture* to CKeyCapture*"


    sorry for bothering you.

    thanks

  14. #14
    Registered User
    Join Date
    Jul 2009
    Posts
    20

    Re: Hide/Show My App and Getting Key Like #123...

    Is it possible that I send you my App by email ?

  15. #15
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: Hide/Show My App and Getting Key Like #123...

    Check class names that you are using:
    Quote Originally Posted by ArvinShahidi View Post
    I have just added

    In MyAppUi.h

    class CKeyCapture;

    class CCapKey2AppUi : public CAknAppUi, MKeyCallBack
    {
    public:

    void ConstructL();

    protected:

    private:

    CKeyCapture* iMyKey;

    };


    in MyAppUi.cpp file

    void CCapKey2AppUi::ConstructL()
    {
    iMyKey = CKeyCapturer::NewL(this);
    }
    If you use class from this article ( http://wiki.forum.nokia.com/index.ph...ui_application ) then add to your MyAppUi.h

    Code:
    #include "KeyCapturer.h"
    ...
    
    class CCapKey2AppUi : public CAknAppUi, public MKeyCallBack
    {
    private:
           // from MKeyCallBack
           void KeysMap(const TDesC& keys);  
    ...
    private:
    
    	CKeyCapturer* iMyKey;
    }
    in MyAppUi.cpp file
    Code:
    void CCapKey2AppUi::ConstructL()
    {
    ...
    iMyKey = CKeyCapturer::NewL(*this);
    }
    
    void CCapKey2AppUi::KeysMap(const TDesC& keys)
    {
    // handle event
    }
    Last edited by A.A.M.; 2009-07-15 at 16:11.

Posting Permissions

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