views:

22

answers:

1

Hello, I've only ever done server, web, and database programming, never any desktop programming. I now want to learn and have a small project I want to attempt, but am not sure which library/framework to use.

I'd like to create a small cross-platform app that runs in the system tray (and whatever the OSX equivalent is), and listens for changes to windows on the Desktop. Specifically:

  1. Windows XP, Vista, 7, Gnome, KDE, OSX. BSD, Android, and/or iOS would be nice too but not required.
  2. Listens for when any window gains focus, loses focus, is opened or closed, or if the window title changes (for example when switching tabs in a tabbed browser). Any other information it can scrape from the window would be useful as well.
  3. Can store these events, preferably in an embedded database like SQLLite.
  4. The lighter-weight the better.
  5. Includes an options GUI accessible via a right-click menu from the system-tray icon.
  6. Preferably FOSS, but if you know any non-FOSS please list too.

Is there a single library or framework that can do all that across multiple platforms? QT? Python? Java? Something else? TIA.

+3  A: 

Almost any GUI framework can easily let you know when your own application gains or loses focus (or the other operations you mention). However, listening for these events for other arbitrary applications is definitely platform-specific and may or may not even be possible.

One framework for doing this on Windows is the CBT callback hook. See the question CBT Hook not working in Windows Vista for information about possible limitations on using this technique.

Greg Hewgill
Thanks Greg, sounds like this is much more difficult and nonstandard than I assumed. Will look into CBT, but it sounds like on Windows at least, there could be issues with relative privilege levels too.
Kurtosis