Similar to this question:
http://stackoverflow.com/questions/12422327/other-application-window-close-event
Is there a way other than Accessibility Model to monitor if another application window was closed (not terminated)? I can't require to have users turn on Accessibility mode in order for this to work. NSWorkspace Notifications will only tell you if the application was terminated.
Related
I am writing a Cocoa Objective-C application for the macOS, and I am using this very good answer here to be notified of window position changes in other applications. Within my app, I can use the event returned by [NSApp currentEvent] to determine the key modifiers. How can I ascertain the same for another app that I am monitoring ? To be simple, I would like to know if a window of an application was moved or resized while pressing the command (or option) key. Many thanks for any help.
I'm working on a macOS Objective-C application that interacts with trackpad and mouse. This kind of interaction needs Accessibility Control. The problem is that if user unticks the app (while it's running) in System Preferences > Security & Privacy > Privacy > Accessibility, it prevents user to work with trackpad and mouse properly, so making hard even to quit the app.
The only thing that I could manage to do with this problem is running Terminal via Spotlight Search and doing killall.
I need the app to stop itself if there is no Accessibility permissions.
You can call AXIsProcessTrusted to determine if you are trusted for accessibility. I'm not aware of any callback or notification when the setting changes, but it sounds like you could just poll every second or so, and exit your app if the function starts to return false.
AXIsProcessTrusted
I am developing a desktop application that capture computer activities on mac osx using objective-c. I know it's possible to capture it when user presses on the keyboard and mouse position. But I don't know how to detect when user switches tasks on computer, like closing a window (of other applications), activating another window (of other applications)?
Does anyone have any experience in that?
Yes, via the Accessibility system. For example the NSAccessibilityMainWindowChangedNotification.
Now, we are developing a window application for play video like TV.
But When it's running full screen, we must block all window notifications.
so i found many ways to disable notifications.
http://www.maketecheasier.com/disable-toast-notifications-in-windows-8/
But we can't use this way, because it's for only Window App Store Applications.
We want to block all Notifications.
connected USB noti, window update noti, etc.
In addition, Our application has property of the Topmost(base on .net C#).
But it can't Blocked.
is it possible to use the user32.dll??
How to solve it, anyway is ok.
sorry for my poor English. Thanks.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to create a Menubar application for Mac
I have implemented a feed with Cocoa, for Mac OS X.
It's a status application, displaying only the menu.Now basically I got three questions:
When I launch it I always see the application icon in the dock.But this is a menu status application, how do I remove the dock icon? It should be an application like Watts and Dropbox, a pure menu;
How do I prevent the user from launching the application multiple times? If the user does so, I would like to not launch a second instance of the application.
How do I prevent the user from launching the application multiple
times? If the user does so, I would like to not launch a second
instance of the application.
That would commonly be done using a filesystem lock (flock) on unix based systems.
But then again, Cocoa has an even simpler solution for that; you may check if an application is active by supplying its bundle identifier to the system.
NSRunningApplication runningApplicationsWithBundleIdentifier:
See the NSRunningApplication Reference for more.