you are not trying to write a malware, are you?
I can't find "Application is agent (UIElement)"? must be add manually?Go into your target's info and set "Application is agent (UIElement)" to YES. That'll change your app to run in the background. It won't show up in the dock or in the force quit menu... The only ways I know of to stop an application that's running that way is to go into Activity Monitor or Terminal and use kill on it.
I can't find "Application is agent (UIElement)"? must be add manually?
edit : I add manually and application run in background but not do correct.
I remove while loop in application source code and set "Application is agent .." to YES but application run once
It won't change the logic of your code - you must find a way to make it run more than once. I often use repeating NSTimers for code that should run every few minutes without user input.
Thanks for your reply.
I want to run my code when focused window(active application) is changed.i don't know what i must be use!
Is there any system event like Change Focused window or app?
I wouldn't think so... What are you trying to do, exactly? It seems to me that often when someone is asking a question like this, they're taking a very difficult approach to an easy problem.