 |
 |
Viewing running processes in Cocoa
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: Texas
Status:
Offline
|
|
First off, thanks for helping on the last problem I had!!! It was exactly what I needed.
Here is my next problem. I need to find and view a running process. The process will be run either with a window or in the terminal. I found how to do it in Carbon, but need to use Cocoa. If you can, point me to a website with examples or just let me know the NS call I need. Thanks!!!
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: Texas
Status:
Offline
|
|
Ahh... used my brain this time and found NSProcessInfo on developer.apple.com... Anyways, if you want to let me know if this is right or wrong, go ahead. If you want to make fun of me because I cant think right now, go ahead. 
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: Texas
Status:
Offline
|
|
Ok, now I can get the name of the process that I am running, basically the name of the program. How do I get another applciations process name?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
Any API that works from Carbon will also work from Cocoa... you can use what you found already.
If you'd rather not, well... Foundation and AppKit don't include any process management utilities. The closest you'll get is NSWorkspace's methods for finding out about other GUI applications. But programming with Cocoa doesn't mean you have to use only ObjC APIs... you can use the same BSD system calls the ps and top utilities do. (You can even check out their source code from Darwin if you need help.)
|
|
|
| |
|
|
|
 |
|
 |
|
Banned
Join Date: Apr 2002
Location: -
Status:
Offline
|
|
there's a very good wrapper around...
search..
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: Texas
Status:
Offline
|
|
HA HA HA!!!  I completely forgot about using ps and top... I will try using NSTask to launch ps or top. Luckily I have done that in C before, so I can do it here. Thanks and if anyone has more suggestions, let me know!
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: Texas
Status:
Offline
|
|
wrapper? I will look for it unless you want to let me know where to look... 
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Oct 2000
Location: Lawrence, KS
Status:
Offline
|
|
I had a similar need a while back and performance was absolutely key. I dug up some basic BSD C code and stuck it in my Coca class. if you can get away with using the Cocoa libs then don't bother with this.
The file name was GetPID.c by Chad Jones. I don't remember where I got it from. Google might find it.
|
|
iMac 17" G4 800MHZ & 768 SDRAM
|
| |
|
|
|
 |
|
 |
|
Banned
Join Date: Apr 2002
Location: -
Status:
Offline
|
|
Search for AGProcess
the most complete cocoa wrapper I know..
good luck
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: Texas
Status:
Offline
|
|
Found AGProcess and will check it out in the morning. Thanks! It looks like what I was looking for.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: Texas
Status:
Offline
|
|
Just wanted to say thanks for the link! I got AGProcess working last night and it works great!
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
Most of AGProcess' functionality is now implemented by NSWorkspace under the -launchedApplications dictionary, isn't it?
Or does AGProcess also do *nix processes?
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: Texas
Status:
Offline
|
|
AGProcess works with *nix processes. I will look for the NSWorkspace here in about 30 minutes. It works really well when you already know the process id of the applications running 
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: Texas
Status:
Offline
|
|
NSWorkspace does not work with unix applications. There is some cool stuff you can do with it though.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|