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.)
TaskMonitorPlus is a fork/expansion of the Task Monitor (aka simply Task) plugin for EventGhost. The original Task Monitor plugin generates events when a window opens, closes, flashes, or gains or loses focus. But the event contains nothing but the name of the executable which created the window.
TaskMonitorPlus still produces these events (as well as a new event for when
a window's title changes), but now they come with a payload.
The eg.event.payload
produced by an event is an object (named WindowInfo,
if you're curious) with the following attributes and methods:
title
: the title of the windowwindow_class
: the internal class name for the windowhwnd
: the internal ID for the windowpid
: the process ID for thet executable owning the windowname
: the executable name of the process owning the window (same as in the event itself)GetParent()
: returns a new object representing the parent of this windowFocus()
: directs focus to the windowHasFocus()
: returns True if the window has focusIsAlive()
: returns True if the window is still openIsActive()
: returns True if this window is the currently active oneAnimate()
: coming soonSendKeystrokes()
: just like the Send Keys action in EventGhostFlash()
: make the window flashBringToTop()
: raise the windowIsVisible()
: returns True if the window isn't hiddenEnableKeyboardMouse()
: enable (or disable) mouse and keyboard input for the windowIsKeyboardMouseEnabled()
: returns True if soRestore()
: restores the window to its previous stateMinimize()
: minimize (or un-minimize) the windowMaximize()
: maximize the windowSetPosition()
: set the window's positionSetSize()
: set the window's sizeSetRect()
: set the window's position and sizeGetRect()
andGetRectTuple()
: return window's position and sizeGetSize()
andGetSizeTuple()
: return window's sizeGetPosition()
andGetPositionTuple()
: return window's positionShow()
: show (or hide) the windowHide()
: hide the windowDestroy()
: destroy the windowClose()
: close the windowSendMessage()
andPostMessage()
: low-level messaging to window
The methods are documented in the source code in detail. This documentation should appear in your IDE and in PyCharm (the Python shell that EventGhost includes under the Help menu).
The window title can change over the window's lifetime. The title
attribute
tries to fetch the most recent window title whenever it's accessed, but if it
can't (like if the window has been closed and no longer exists) it returns
the last known title.
You should remove the Task Monitor plugin (which ships with EventGhost) from your Autostart list, if it's there, before installing Task Monitor Plus. Don't just disable Task Monitor, because it may still interfere with Task Monitor Plus as long as it's installed.
You can install this plugin and activate it like any other.
If you've used the standard Task Monitor plugin, the behaviour is identical,
except that the events produced start with TaskMonitorPlus.
instead
of Task.
.
In case you aren't familiar with the standard Task Monitor plugin, here's how you can use it: at the bottom of the EventGhost window, uncheck the checkbox that says "Log only assigned and activated events", then open or switch to a window which you'd like to take action on. You'll see an entry appear in the log that looks something like this:
TaskMonitorPlus.NewWindow.notepad <title=u'Untitled - Notepad', window_class=u'Notepad',...>
You can drag this entry from the log into any macro you've created, to cause the actions in that macro to be played back the next time that action takes place.
You can access the payload object from follow-on actions via the
eg.event.payload
object. For a simple example, to flash an on-screen display
of the current window's title when Notepad opens, you could add the
the EventGhost → Show OSD action to a macro, and enter something like
"New window opened: {eg.event.payload.title}" in the "Text to display" field.
For more information on using EventGhost, consult the EventGhost website, wiki, and forums.
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-TaskMonitorPlus. However, remember that this is not originally my work (although admittedly we've changed it a fair bit these days) . If you experience problems with Task Monitor Plus, please check if the problem also happens when you use the original Task Monitor plugin.
Boolean263 (aka David Perry) and kgschlosser, based on work by Bitmonster and blackwind
The original, canonical Task Monitor ships with EventGhost. This version is based on version 1.0.4 of that plugin (which was copied from the 0.5.0-rc4 release of EventGhost) and modified, based on ideas I had in (and feedback I received on) my EventGhost-WindowWatcher plugin.
- Fix
reported
EventGhost freeze when getting the title of EventGhost windows
(unfortunately, this means that
eg.event.payload.title
is no longer meaningful for windows created by EventGhost itself)
- Improve caching of window title and class (should now behave better for windows that legitimately have an empty string for either)
- Raise a
WindowInfo.DeadWindow
exception when attempting to modify windows that no longer exist (many query functions, such asIsActive()
, don't raise this and simply returnFalse
;GetRect()
and the like still raise an exception) - Raise a
WindowInfo.NoParent
exception (instead of the oldValueError
) when callingGetParent()
on a window with no parent
- Removed TaskHook.dll since it's not actually needed (thanks kgschlosser for the find)
- Added the TitleChanged event after discovering the
HSHELL_REDRAW
event type (the event payload contains the window's new title) - Improved plugin documentation that shows within EventGhost
- Add new WindowInfo methods (thanks kgschlosser)
- Bugfix: this plugin was breaking the event log if it tried to report a
window that had non-ASCII characters in its title. I don't know if this
is a bug in EventGhost itself or what, but I fixed it by using
repr()
to return the window title.
- Initial release of the Plus version of this plugin