Hello,
Sorry if the question is too lame, but i start to code my first Symbian application just few days ago and i'm not so familiar with this OS still...
I have an application, which is called by CaptureKey. I need to know the application, which was active, when the keypress of my capture key occurs :
If i use this code, i can get the window group, but i need the application as a TApaTask :
TKeyResponse CMyAppUi::HandleKeyEventL(
const TKeyEvent& aKeyEvent,TEventCode aType )
{
if ( aType == EEventKeyDown && aKeyEvent.iScanCode == hotKeyCode )
{
focusID = CCoeEnv::Static()->WsSession().GetFocusWindowGroup();
}
}
Something like this (here i assume, that the Notes application was active, but i need the real one :
TKeyResponse CMyAppUi::HandleKeyEventL(
const TKeyEvent& aKeyEvent,TEventCode aType )
{
if ( aType == EEventKeyDown && aKeyEvent.iScanCode == hotKeyCode )
{
TApaTaskList tasklist(CCoeEnv::Static()->WsSession());
TApaTask *mytask = new (ELeave) TApaTask( tasklist.FindApp( _L("Notepad"😉 ) );
}
}
Jordan