28 aug 2008 kl. 12.36 skrev Phil Faber:

Is there a simple way to quit all running applications?

Basically I want to achieve the same result as the first stage of hitting 'shut down' (closing all applications) without actually shutting down the system.

Take a look at the NSWorkspace class. The launchedApplications: method will give you an array of running applications including their process id. A simple solution would be to use NSTask to invoke the kill command on each of them. Just remember to remove you application from the array or it will be killed as well.

By the way, in what situation do you want to kill all running applications?

Marcus


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to