Io non riesco più a capire niente

Cioè sembra che il codice lo esegua in modo giusto ma non dà nessun risultato!! Secondo te dove sbaglio??
(Nessun warning oppure errori in compilazione)
extern "C" PyObject *
set_system(PyObject* /*self*/, PyObject* args) // Richiamo la funzione da python passandogli l'UID dell'app che mi interessa rendere nascosta
{
TUid uid;
if (!PyArg_ParseTuple(args, "i", &uid))
return NULL;
RWsSession& wsSession = CEikonEnv::Static()->WsSession();
CApaWindowGroupName* wgName=CApaWindowGroupName::NewL(wsSession);
CleanupStack::PushL(wgName);
CArrayFixFlat<TInt>* WindowGroupIds = new(ELeave)CArrayFixFlat<TInt>(1);
CleanupStack::PushL(WindowGroupIds);
User::LeaveIfError(wsSession.WindowGroupList(0,WindowGroupIds));
const TInt count = WindowGroupIds->Count();
for (TInt ii=0; ii<count; ii++)
{
TInt wgId = WindowGroupIds->At(ii);
wgName->ConstructFromWgIdL(wgId);
if (wgName->AppUid()==uid)
{
wgName->SetHidden(ETrue); //Ne questo
wgName->SetSystem(ETrue); //Ne questo vanno!
CleanupStack::PopAndDestroy(2);//WindowGroupIds, wgName
return Py_True; //Sono sicuro che arriva qui perchè mi ritorna 1
//break;
}
//wgName->SetHidden(ETrue);
//wgName->Caption()
//wgName->AppUid().Name()
//wgName->Hidden()
//wgName->IsSystem()
//wgName->IsBusy()
//wgName->AppUid()
}
return Py_False; // Se metto un UID sbagliato va qui ovviamente
}
EDIT: ho trovato che si può cercare in un altro modo la finestra, provo pure questo!:
void CExampleAppUi::SendKeyTest()
{
TKeyEvent event;
event.iRepeats=0;
event.iScanCode=0;
event.iModifiers=EModifierCtrl | EModifierShift;
event.iCode=CTRL('t'); // defined in COEDEF.H
_LIT(KAppCaption,"System");
RWsSession& ws=iEikonEnv->WsSession();
TInt previous=0;
CApaWindowGroupName::FindByCaption(KAppCaption,ws,previous);
TApaTask task(ws);
task.SetWgId(previous);
if (!task.Exists())
User::Leave(KErrNotFound);task.BringToForeground(); // So we can see the results
task.SendKey(event);
}
Messaggio modificato da memoryn70 il 16 agosto 2008 - 11:58