madhacker Pubblicato: 23 Luglio 2009 Autore Segnalazione Share Pubblicato: 23 Luglio 2009 grazie dei consigli, ho aggiornato il primo post Link to comment Condividi su altri siti More sharing options...
discostu Pubblicato: 16 Febbraio 2010 Segnalazione Share Pubblicato: 16 Febbraio 2010 Non è ancora stato effettuato il porting della libreria compatibile con il python 1.9.x? Link to comment Condividi su altri siti More sharing options...
madhacker Pubblicato: 17 Febbraio 2010 Autore Segnalazione Share Pubblicato: 17 Febbraio 2010 (modificato) si, in effetti la usavo già da parecchio tempo per le mie applicazioni la puoi scaricare da QUI compatibilità 1.9.x (anche 2.0) Modificato 17 Febbraio 2010 da madhacker Link to comment Condividi su altri siti More sharing options...
discostu Pubblicato: 17 Febbraio 2010 Segnalazione Share Pubblicato: 17 Febbraio 2010 si, in effetti la usavo già da parecchio tempo per le mie applicazionila puoi scaricare da QUI compatibilità 1.9.x (anche 2.0) Grazie mad, gentile e disponibile come sempre Link to comment Condividi su altri siti More sharing options...
memoryn70 Pubblicato: 16 Ottobre 2010 Segnalazione Share Pubblicato: 16 Ottobre 2010 Grazie mad, gentile e disponibile come sempre Già! E ne approfitto per chiederti due cosette: Potresti aggiungere la possibilità di killare processi come appswitch (stesso metodo, magari copi direttamente il codice così c'è compatibilità) Potresti aggiungere la possibilità in send_fg di indicare il parametro (che sarebbe il titolo o uid dell'applicazione) di quale app mandare in fg? Grazie ps: tutto questo per eliminare completamente appswitch e facilitare i port futuri (sto lavorando su winfile come sai hehe) Link to comment Condividi su altri siti More sharing options...
madhacker Pubblicato: 23 Ottobre 2010 Autore Segnalazione Share Pubblicato: 23 Ottobre 2010 quella per python 2.0? attualmente msys killa i processi così msys.killapp(u'Menu') a te come torna comodo? per quanto riguarda il foreground, si fa prima se mi posti il codice Link to comment Condividi su altri siti More sharing options...
memoryn70 Pubblicato: 23 Ottobre 2010 Segnalazione Share Pubblicato: 23 Ottobre 2010 quella per python 2.0? attualmente msys killa i processi così msys.killapp(u'Menu') a te come torna comodo? per quanto riguarda il foreground, si fa prima se mi posti il codice Si certo per python 2 (mai più mi metto a lavorare con la vecchia versione! ) x il foreground ecco: #include <e32std.h> #include <e32base.h> #include <apgtask.h> #include <eikenv.h> #include "Python.h" #include "symbian_python_ext_util.h" TBool TryToBringForeground(const TDesC& aCaption) { TApaTaskList taskList(CEikonEnv::Static()->WsSession()); TApaTask task(taskList.FindApp(aCaption)); if (task.Exists()) { task.BringToForeground(); } return task.Exists(); } static PyObject* switch_to_fg(PyObject* /*self*/, PyObject *args) { char* b = NULL; TInt l = 0; if (!PyArg_ParseTuple(args, "u#", &b, &l)) { return 0; } TPtrC caption((TUint16*)b, l); if (TryToBringForeground(caption)) { Py_INCREF(Py_True); return Py_True; } else { Py_INCREF(Py_False); return Py_False; } } static const PyMethodDef appswitch_methods[] = { {"switch_to_fg", (PyCFunction)switch_to_fg, METH_VARARGS}, {0, 0} /* sentinel */ }; DL_EXPORT(void) init_iapconnect() { Py_InitModule("appswitch", (PyMethodDef*) appswitch_methods); } GLDEF_C TInt E32Dll(TDllReason) { return KErrNone; } Per killare i processi intendevo proprio terminarli (killapp non termina il task??) cmq qui il codice (l'aveva fatte dokkis certe aggiunte!) #include <e32std.h> #include <e32base.h> #include <apgtask.h> #include <apgcli.h> #include <eikenv.h> #include <apgwgnam.h> #include "Python.h" #include "unicodeobject.h" #include "symbian_python_ext_util.h" enum TTaskOperations { ETaskForeground, ETaskBackground, ETaskKill, ETaskEnd, }; void GetRunningApplicationTitlesL(CDesCArray& aArray, TBool aIncludeHidden) { // this code is somewhat borrowed from Switcher application RWsSession ws(CEikonEnv::Static()->WsSession()); RApaLsSession rs; CApaWindowGroupName* wgName; TApaAppInfo ai; User::LeaveIfError(rs.Connect()); CleanupClosePushL(rs); CArrayFixFlat<TInt>* wgl = new (ELeave) CArrayFixFlat<TInt>(5); CleanupStack::PushL(wgl); User::LeaveIfError(ws.WindowGroupList(wgl)); wgName = CApaWindowGroupName::NewLC(ws); for(TInt i = 0; i < wgl->Count(); i++) { wgName->ConstructFromWgIdL(wgl->At(i)); if(!aIncludeHidden && wgName->Hidden()) { continue; } TPtrC caption; caption.Set(wgName->Caption()); if(!caption.Length()) { continue; } aArray.AppendL(caption); } CleanupStack::PopAndDestroy(wgName); CleanupStack::PopAndDestroy(wgl); CleanupStack::PopAndDestroy(); // rs } static PyObject* _perform_task_operation(TTaskOperations aTask, PyObject *args) { char* b = NULL; TInt l = 0; if (!PyArg_ParseTuple(args, "u#", &b, &l)) { return 0; } TPtrC caption((TUint16*)b, l); TApaTaskList taskList(CEikonEnv::Static()->WsSession()); TApaTask task(taskList.FindApp(caption)); if (!task.Exists()) { Py_INCREF(Py_False); return Py_False; } switch (aTask) { case ETaskForeground: task.BringToForeground(); break; case ETaskBackground: task.SendToBackground(); break; case ETaskKill: task.EndTask(); break; case ETaskEnd: task.KillTask(); break; } Py_INCREF(Py_True); return Py_True; } static PyObject* switch_to_fg(PyObject* /*self*/, PyObject *args) { return _perform_task_operation(ETaskForeground, args); } static PyObject* switch_to_bg(PyObject* /*self*/, PyObject *args) { return _perform_task_operation(ETaskBackground, args); } static PyObject* kill_app(PyObject* /*self*/, PyObject *args) { return _perform_task_operation(ETaskKill, args); } static PyObject* end_app(PyObject* /*self*/, PyObject *args) { return _perform_task_operation(ETaskEnd, args); } static PyObject* application_list(PyObject* /*self*/, PyObject * args) { TBool includeHidden; if (!PyArg_ParseTuple(args, "i", &includeHidden)) { return 0; } CDesCArray* array = new (ELeave) CDesCArrayFlat(5); CleanupStack::PushL(array); TRAPD(err, GetRunningApplicationTitlesL(*array, includeHidden)); if (err) { return SPyErr_SetFromSymbianOSErr(err); } PyObject *appstuple; appstuple = PyTuple_New(array->Count()); for (TInt i = 0; i < array->Count(); i++) { PyObject *str = Py_BuildValue("u#", (*array)[i].Ptr(), (*array)[i].Length()); PyTuple_SET_ITEM(appstuple, i, str); } CleanupStack::PopAndDestroy(array); return appstuple; } static const PyMethodDef appswitch_methods[] = { {"switch_to_fg", (PyCFunction)switch_to_fg, METH_VARARGS}, {"switch_to_bg", (PyCFunction)switch_to_bg, METH_VARARGS}, {"end_app", (PyCFunction)end_app, METH_VARARGS}, {"kill_app", (PyCFunction)kill_app, METH_VARARGS}, {"application_list", (PyCFunction)application_list, METH_VARARGS}, {0, 0} /* sentinel */ }; DL_EXPORT(void) init_appswitch() { Py_InitModule("appswitch", (PyMethodDef*) appswitch_methods); } GLDEF_C TInt E32Dll(TDllReason) { return KErrNone; } Link to comment Condividi su altri siti More sharing options...
memoryn70 Pubblicato: 23 Ottobre 2010 Segnalazione Share Pubblicato: 23 Ottobre 2010 Ops ho sbagliato! Qui il codice per i processi di Dokkis static PyObject* kill_process(PyObject* /*self*/, PyObject *args) { char* b = NULL; TInt l = 0; if (!PyArg_ParseTuple(args, "u#", &b, &l)) { return 0; } TPtrC caption((TUint16*)b, l); TFindProcess findProc; findProc.Find(caption); TFullName procName; TInt err = findProc.Next(procName); if (!err) { RProcess process; err = process.Open(procName, EOwnerThread); if (!err) { process.Terminate(KErrCancel); process.Close(); } else { return SPyErr_SetFromSymbianOSErr(err); } } else { return SPyErr_SetFromSymbianOSErr(err); } return Py_True; } Link to comment Condividi su altri siti More sharing options...
madhacker Pubblicato: 27 Ottobre 2010 Autore Segnalazione Share Pubblicato: 27 Ottobre 2010 scusa, avevo confuso applicazione con processi... a breve ti posterò la nuov(issim)a versione Link to comment Condividi su altri siti More sharing options...
madhacker Pubblicato: 27 Ottobre 2010 Autore Segnalazione Share Pubblicato: 27 Ottobre 2010 (modificato) http://code.google.com/p/batch-profiler/downloads/detail?name=msys.sis&can=2&q= msys 0.9.5 * -------------------------------------- * VERSION 0.9.5 * -------------------------------------- * msys.version() * msys.kill_process(u'Menu') * msys.switch_to_fg(u'Menu') * msys.switch_to_bg(u'Menu') * -------------------------------------- se vuoi, puoi aggiungerlo al topic delle librerie (per ora è solo python 2.0) Modificato 27 Ottobre 2010 da madhacker Link to comment Condividi su altri siti More sharing options...
memoryn70 Pubblicato: 29 Ottobre 2010 Segnalazione Share Pubblicato: 29 Ottobre 2010 http://code.google.com/p/batch-profiler/downloads/detail?name=msys.sis&can=2&q= msys 0.9.5 * -------------------------------------- * VERSION 0.9.5 * -------------------------------------- * msys.version() * msys.kill_process(u'Menu') * msys.switch_to_fg(u'Menu') * msys.switch_to_bg(u'Menu') * -------------------------------------- se vuoi, puoi aggiungerlo al topic delle librerie (per ora è solo python 2.0) Benissimo! Grazie mille! Passo in più per il port e per avere meno librerie di mezzo... Appena ho tempo metto in lista lib e la provo... Link to comment Condividi su altri siti More sharing options...
memoryn70 Pubblicato: 31 Ottobre 2010 Segnalazione Share Pubblicato: 31 Ottobre 2010 Benissimo! Grazie mille! Passo in più per il port e per avere meno librerie di mezzo... Appena ho tempo metto in lista lib e la provo... Ciao! Ecco ora ho provato: -switch_to_bg: funziona, se app esiste True, se non è aperta False -switch_to_fg: funziona, se app esiste True, se non è aperta False -kill_process: se passo un nome non in esecuzione da errore, altriment se scrivo per esempio Messaggi oppure Messaggi[100058c5]0001 oppure Messaggi* (tutti validi) l'applicazione crasha senza terminare nulla. Ah se riesci puoi compilarmela x 2nd ed? Altrimenti posta il sorgente che me lo compilo Link to comment Condividi su altri siti More sharing options...
memoryn70 Pubblicato: 31 Ottobre 2010 Segnalazione Share Pubblicato: 31 Ottobre 2010 Anche la funzione thread fa crashare tutto su 5th ed! Non è che ho problemi di caps? Io non credo altrimenti non andrebbero nemmeno process e task Link to comment Condividi su altri siti More sharing options...
madhacker Pubblicato: 2 Novembre 2010 Autore Segnalazione Share Pubblicato: 2 Novembre 2010 per usare msys.kill_process() dovrai usare il nome completo del processo ad esempio msys.kill_process(u'Menu[101f4cs2]0001') su sdk funziona, domani lo proverò anche su cellulare e ti farò sapere Link to comment Condividi su altri siti More sharing options...
aaping Pubblicato: 8 Novembre 2010 Segnalazione Share Pubblicato: 8 Novembre 2010 Can you for me the 'set_system' Source code ? Link to comment Condividi su altri siti More sharing options...
memoryn70 Pubblicato: 9 Novembre 2010 Segnalazione Share Pubblicato: 9 Novembre 2010 Can you for me the 'set_system' Source code ? TInt wgId = CEikonEnv::Static()->RootWin().Identifier(); RWsSession session = CEikonEnv::Static()->WsSession(); CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC(session, wgId); wgName->SetHidden(ETrue); wgName->SetWindowGroupName(CEikonEnv::Static()->RootWin()); CleanupStack::PopAndDestroy(); // wgName result.SetNull(); } { CEikonEnv::Static()->SetSystem( ETrue ); result.SetNull(); } Here it is! But it's not from msys...I think it's the same Link to comment Condividi su altri siti More sharing options...
memoryn70 Pubblicato: 9 Novembre 2010 Segnalazione Share Pubblicato: 9 Novembre 2010 Sorry...the first is to hide application and the second to set is system! Link to comment Condividi su altri siti More sharing options...
aaping Pubblicato: 9 Novembre 2010 Segnalazione Share Pubblicato: 9 Novembre 2010 Thanks... Link to comment Condividi su altri siti More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Accedi Ora