Skip to content

Boolean263/EventGhost-WindowWatcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

EventGhost-WindowWatcher

This plugin is deprecated and no longer supported. You should look at Boolean263/EventGhost-TaskMonitorPlus instead.

This program is not very useful on its own. It's a plugin for EventGhost. EventGhost is an automation tool for MS Windows which listens for events -- whether user-triggered (like the press of a hotkey) or system events (such as the screensaver activating) -- and runs actions you specify. (It's like Tasker for Android, or Cuttlefish for Ubuntu.)

Description

WindowWatcher is an event plugin for EventGhost. It generates events for your macros to act on when it detects that you've switched windows, or when a new window opens.

Currently, it does this by polling regularly (every second, by default) to see what window is active, and what windows are open. If there's a change to either, it sends an event.

Possible uses:

  • Enabling application-specific hotkeys/macros
  • Detecting and closing nagware windows
  • Auto-minimize a window when you switch away from it
  • ...

Usage

When you load the plugin, you will be presented with a few configuration options.

  • Poll time for changes: how often the plugin checks for the conditions given below. Defaults to 1 second. Shorter times will let the plugin detect changes more quickly, but may add extra load to EventGhost or your computer.
  • Trigger events on window activate/deactivate: If either of these are checked, the plugin will check what window you're currently using. When you change windows, you can optionally send an event for the window you've switched to (Activate) or switched from (Deactivate).
  • Trigger events on window open: If this is checked, the plugin will make a list of currently open windows, and fire an event for each window it finds open that wasn't open on the last check.
  • Set target window as Found: If you check this, the plugin tells EventGhost about the window in the event, so you can use actions in the Window category directly.

The events generated by this plugin are in the following form:

WindowWatcher.Activate.EVENTGHOST.EXE

The second word is the window activity that triggered the event, and the third word is the name of the process which owns the window. The plugin provides more details about the window in question in the payload. The payload (which you can access in future steps as eg.event.payload) is an object with the following properties:

  • id: the numeric ID of the window as recognized by Windows itself
  • process: the program name responsible for the window
  • title: the complete title of the window
  • window_class: the internal class name of the window
  • is_visible: whether the window is currently visible
  • is_enabled: whether the window is currently enabled

Downloads and Support

Official releases of this plugin are being made available at this thread on the EventGhost forums. You can also provide feedback and request support there.

I also accept issues and pull requests from the official GitHub repo for this project, Boolean263/EventGhost-WindowWatcher.

Future Improvements

If there's a need for it, I can add code to allow the plugin to generate events for windows that close. None of the event payload items (except for id) can be fetched since the window no longer exists, so I'd have to add a cache of all the interesting window properties.

I originally tried to implement this plugin by hooking into Windows via the SetWindowsHookEx(WH_CBT,...) function to watch for CBT_ACTIVATE and other such events. Windows seems to need a compiled DLL to allow this. That's beyond my ability right now, but perhaps someone else can add it.

Author

Boolean263, aka David Perry

Changelog

v0.0.1 - 2017-08-18

  • Initial release

About

Trigger EventGhost events when the current window changes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published