Hi All,
I need the currentWindowgroup uid, i implemented like this.
The problem is its giving contentiously 2 uids, and always giving Statby uid is one and another is that application id.

In my Application user in defeault telephony mode he press EKeyok my application comes to foreground, for this i capture the EKeyok using this code.

After that i compare the uid of the current focus windowgroup id if it is telephony uid bring my app to foreground,else the was not consumed key.
but the GetFocusWindowGroup is always giving stand by mode,
please help me ...

ConstructL()
{
SetKeyBlockMode(EDefaultBlockMode);

Key2 = iEikonEnv->RootWin().CaptureKeyUpAndDowns(EStdKeyDevice3,0,0 );
}
//Destructor
{
iEikonEnv->RootWin().CancelCaptureKeyUpAndDowns(Key2);
}
TKeyResponse CHelloWorldBasicAppUi::HandleKeyEventL(const TKeyEvent& KeyEvent,
TEventCode aType)
{

//its always giving two uids,

const TUid KUidStandby = {0x101fd64c}; // 3rd edition - standby screen
const TUid KUidTelephony = {0x100058b3}; // Phone App
const TUid KUidTelephony1 = {0x10207218};

RWsSession iWsSession;
User::LeaveIfError(iWsSession.Connect());

TInt lCurrentWGID = iWsSession.GetFocusWindowGroup();

CApaWindowGroupName* lApaWGName;

lApaWGName = CApaWindowGroupName::NewLC(iWsSession,lCurrentWGID);//lCurrentWGID giving two values , in that first value is overriding

TUid lUid = lApaWGName->AppUid();
TBuf<200>lBuf;
lBuf = lApaWGName->AppUid().Name();
iEikonEnv->AlertWin(lBuf);//for ref
CleanupStack::PopAndDestroy(); // gn
iWsSession.Close();

if(lUid == KUidTelephony )

{
if(KeyEvent.iScanCode == EStdKeyDevice3 ) //EStdKeyHash)
{

TApaTask task(iEikonEnv->WsSession( ));
task.SetWgId(CEikonEnv::Static()->RootWin().Identifier());
task.BringToForeground();
return EKeyWasConsumed;

}
else
{
return EKeyWasNotConsumed;
}
}
else
{

return EKeyWasNotConsumed;
}

}
TInt Key2;
please check once this code if possible run please in emulator also this code for 3rd edition E61.