Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: discovering if a process is busy



on 2007-12-19 3:23 PM, justin webster at email@hidden wrote:

> So is there any way to figure out if a process is busy or idle?
> I understand there was a way in OS9 to establish the total time a
> process has been active but it apparently returns 0 in OSX.
> 
> I am basically trying to establish that a process is idle before
> sending it keystrokes.

There are functions in Quartz Event Taps -- a C API -- that return the
elapsed time since the last hardware input event of any kind, and also since
the last hardware input event of specified kinds. If I recall correctly --
it's been a long day -- you can limit the functions to specific applications
as well as getting the information globally. The event taps API is available
in Tiger and Leopard. Look at the "Quartz Event Services" documentation.

I would give you a more precise documentation reference, but Xcode now
always crashes when I try to search the documentation -- since uploading the
December docset updates.

Just because the user isn't hitting the keyboard or moving the mouse doesn't
mean the application is idle, of course. It might be running a lengthy
operation, or doing something on a timer, or being manipulated via Apple
events or other means, locally or over a network.

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
www.quecheesoftware.com

PreFab Software - www.prefabsoftware.com


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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/email@hidden

This email sent to email@hidden

References: 
 >discovering if a process is busy (From: justin webster <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.