Hide/Show My App and Getting Key Like #123...
Hi, I could hide my application by this code:(Symbian 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
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).
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:
" [url]http://wiki.forum.nokia.com/index.php/Capture_Key_sequence_in_non-gui_application[/url] "
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. ?
Re: Hide/Show My App and Getting Key Like #123...
try it like:
CKeyCapture* MyKey = new(ELeave)CKeyCapture();
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;
...
}
[/code]
in MyAppUi.h cpp in MyAppUi::ConstructorL()
[code]
iMyKey = CKeyCapture::NewL( this );
[/code]
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,
Re: Hide/Show My App and Getting Key Like #123...
Are you sure that you have already declared iMyKey in the header file?
Re: Hide/Show My App and Getting Key Like #123...
also your appui is not derived from MKeyCallBack
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
Re: Hide/Show My App and Getting Key Like #123...
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
Re: Hide/Show My App and Getting Key Like #123...
try like this iMyKey = CKeyCapture::NewL( [B]*this[/B] );
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
Re: Hide/Show My App and Getting Key Like #123...
Is it possible that I send you my App by email ?
Re: Hide/Show My App and Getting Key Like #123...
Check class names that you are using:
[QUOTE=ArvinShahidi;616273]I have just added
In MyAppUi.h
class [COLOR="Blue"]CKeyCapture[/COLOR];
class CCapKey2AppUi : public CAknAppUi, MKeyCallBack
{
public:
void ConstructL();
protected:
private:
[COLOR="Blue"]CKeyCapture[/COLOR]* iMyKey;
};
in MyAppUi.cpp file
void CCapKey2AppUi::ConstructL()
{
iMyKey = [COLOR="Red"]CKeyCapturer[/COLOR]::NewL(this);
}
[/QUOTE]
If you use class from this article ( [url]http://wiki.forum.nokia.com/index.php/Capture_Key_sequence_in_non-gui_application[/url] ) 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;
}[/CODE]
in MyAppUi.cpp file
[CODE]
void CCapKey2AppUi::ConstructL()
{
...
iMyKey = CKeyCapturer::NewL(*this);
}
void CCapKey2AppUi::KeysMap(const TDesC& keys)
{
// handle event
}
[/CODE]