2006/9/28, A.J. Venter <[EMAIL PROTECTED]>:
Just a simple question: would that be possible to simply query the
> list of actual processes that are running? 'ps ax' for example; then
> you can find your application?
Yep, you could do this with a TProcess - however, having said that - as
I said before when this same question was discussed - the best tool for
the job is xlsclients - which lists open WINDOWS in the current X server.
If your app is in there, you know it's already running - at least if
it's a graphical app.
So you could tprocess around xlsclients, or better yet, somebody can
read the xlsclients source code, and write a wrapper component mapping
the appropriate xlib calls into lazarus once and for all :)
I knew there was a simple solution. But for services/non-gui
applications you would need another way. Same thing if your
application has a two state with or without gui.
Thank you for your post. I'll remember that when I'll need it. :)
PS: In fact, someone could do a simple class that does exactly the
thing on any OS by using the most appropriate method for the OS it is
compiled for. Standard class with different implementations.
--
Alexandre Leclerc
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives