Hi All,

i have written one program to catch screen change events in s60 3rd ed. the problem is with that, its catching screen change event only once and also disabling numbers, alphabets, LSK and RSK. pls point out where i am going wrong....

this is the code i have written and i used AO for this...

void CWindowServer::ConstructL()
{
CActiveScheduler::Add(this);
User::LeaveIfError(iMyOwnSession.Connect());
iMyWindowGroup=RWindowGroup(iMyOwnSession);
User::LeaveIfError(iMyWindowGroup.Construct((TUint32)this,EFalse));

iMyWindowGroup.SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront);
iMyWindowGroup.EnableReceiptOfFocus(ETrue);
User::LeaveIfError(iMyWindowGroup.EnableFocusChangeEvents());
User::LeaveIfError(iMyWindowGroup.EnableGroupChangeEvents());
Listen();
}
void CWindowServer::RunL()
{

// Get the event from the window server session iWs
TWsEvent wsEvent;
iMyOwnSession.GetEvent(wsEvent);
// Get the event type: types are defined in TEventCode
switch (wsEvent.Type())
{
// Window-group related event types
case EEventFocusGroupChanged:
{
TInt wgid = iMyOwnSession.GetFocusWindowGroup();
break;
}
default:
break;

}

if (iStatus != KErrCancel)
{
Listen();
}
}void CWindowServer::Listen()
{
iMyOwnSession.EventReady(&iStatus);
SetActive();
}

pls do tell me where i am going wrong??