I want to develop a screen shot tool in mac,I need to get the top window under my mouse.
There is "ChildWindowFromPointEx" API in Windows OS, but Mac is more complex.
Does anybody know how to deal with it? Thanks very much
windowNumber returns the number of the frontmost window that would be hit by a mouse-down at the specified screen location. According to the apple docs.
Related
I'm building an Adobe AIR 2.5 app that I have working the way I want in Windows in that you can minimize it to the system tray and no icon shows up in the tab order or task bar. What I'm wondering is, can you replicate this in OS X? I want there to be a menu bar extra item to show in the upper right hand corner and also be able to hide it from the Dock when running. I haven't been able find any resources and any tips would be greatly appreciated.
I do not think what you want is possible.
https://bugbase.adobe.com/index.cfm?event=bug&id=2875209
Maybe in AIR 3.0. We'll see.
I am trying to build an Adobe AIR app that runs on two monitors with an extended desktop. Is that possible?
I've read fullscreen is restricted to a single display and the only option is to maximize the app to both displays. Is that right? If so, how can I hide OSX top menu bar?
Just for the record, OSX does not allow you to have more than one full screen applications (of any kind, not just AIR) open at the same time nor it let's you to expand a full screen app to more than one display.
An application window can span multiple displays as long as the window is sized properly. Menubar and dock can also be hidden. Check NSWindow in the apple documentation for more info. Adobe may or may not support this feature.
I want to observe any window on OSX if it is moved. I don't own the windows so i can't get to it directly so I think I have to use the Accessibility APIs. I found a solution for the current active Application here: How can my app detect a change to another app's window? but I can't figure out how I have to modify this that it works for any window which is open. I hope anybody could give me a hint in which direction I have to look.
As I mentioned in the comments, people usually only want to detect window-move events on focused windows. (As unfocused windows seldom move.) If you want to detect application switches, you can poke into this sample project by Apple that shows how to update iChat status with the frontmost application’s name. And as you said, there’s already a solution for an active window.
Following up on this ( Display System Keyboard Mac application? ) question, the keyboard is coming up fine, but if my application is in fullscreen mode, the keyboard launches, but remains in the background. How do I get around this? Any help is much appreciated!
Thanks,
Teja
Full screen is, by definition, above other windows and elements. I don't know how well this would work, but you could try asking the view for its -window, then using -setLevel: to lower the window level. Unfortunately, assuming it works at all, this would probably allow other elements (like the dock or other floating panels above your full screen view as well.
I was surprised this doesn't happen automatically, but I would like my applications window to be in focus as I click its dock icon, when in minimized mode.
Just to clarify, when I minimize the app, the window goes to dock, but when I click the its corresponding Dock Icon, the window don't come in focus.
Is there anything I am missing?
I am using Qt 4.5.3 on Mac OS X 10.5, 10.6
Thanks for help.
Rahul
First answer: That's the expected behavior of a Mac app. Try Safari for example. An app can be active without showing any window. In that case, only the menu bar at the top shows that the active app is changed. So, unless absolutely necessary, you shouldn't bring the minimized window back unless the user explicitly does so. That's the Mac way!
Second answer: I understand that there are cases where you want to bring the minimized window up. In Cocoa, the application delegate method -applicationDidBicomeActive is called when the application gets the focus, and there you can bring the window up yourself. I'm sure Qt also has a similar event/callback/signal or whatever, but I don't know any Qt ... :p Sorry I can't be of any help.