WindowWatcher plugin - v0.0.1

Questions and comments specific to a particular plugin should go here.
User avatar
Boolean263
Plugin Developer
Posts: 81
Joined: Sat Aug 12, 2017 7:52 pm
Location: Ottawa, Canada
Contact:

WindowWatcher plugin - v0.0.1

Post by Boolean263 » Fri Aug 18, 2017 8:35 pm

I'm back with another plugin! This time I wanted to learn how to generate useful events.

WindowWatcher is a plugin which can send an event when you change windows, or when you open a new window, with information about the window in question. Events take the form "WindowWatcher.Activate.EVENTGHOST.EXE" (in this case, the window I switched to was owned by EventGhost). They also carry a payload with hopefully useful properties:
  • eg.event.payload.id: the numeric ID of the window as recognized by Windows itself
  • eg.event.payload.process: the program name responsible for the window
  • eg.event.payload.title: the complete title of the window
  • eg.event.payload.window_class: the internal class name of the window
  • eg.event.payload.is_visible: whether the window is currently visible
  • eg.event.payload.is_enabled: whether the window is currently enabled
You can also tell the plugin to stuff the subject window into EventGhost's "Found" buffer, so you can use Window actions on it without having to do a separate "Find a Window" action. (This is disabled by default.)

Source code and full documentation: Boolean263/EventGhost-WindowWatcher on gitlab

Releases: will be attached to this forum post.
Attachments
WindowWatcher-0.0.1.egplugin
(3.64 KiB) Downloaded 46 times
Windows 10 Home, version 1703, build 15063.540 · EventGhost 0.5.0-rc4 · wxPython 3.0.2.0
Python programmer for fun and profit. Dabbler in EventGhost plugin writing. Wiki gardener. General geek.

User avatar
kgschlosser
Site Admin
Posts: 3115
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: WindowWatcher plugin - v0.0.1

Post by kgschlosser » Sat Aug 19, 2017 3:00 am

there is a very similar plugin called task monitor
If you like the work I have been doing then feel free to Image

User avatar
Boolean263
Plugin Developer
Posts: 81
Joined: Sat Aug 12, 2017 7:52 pm
Location: Ottawa, Canada
Contact:

Re: WindowWatcher plugin - v0.0.1

Post by Boolean263 » Sat Aug 19, 2017 3:15 am

kgschlosser wrote:there is a very similar plugin called task monitor
Oh hey, so there is! And it looks like it uses a DLL, which means it can hook into Windows events, making it better than the polling method I use. Cool stuff.

On the flip side, Task Monitor doesn't have a payload with its event. Having something like the window class could be handy. But really, my version was for practice and not because I really needed it, so it's not a critical loss.

I still feel like a doofus for missing it. EventGhost has so many plugins that it's easy to overlook some of them. Thanks for pointing it out!
Windows 10 Home, version 1703, build 15063.540 · EventGhost 0.5.0-rc4 · wxPython 3.0.2.0
Python programmer for fun and profit. Dabbler in EventGhost plugin writing. Wiki gardener. General geek.

User avatar
kgschlosser
Site Admin
Posts: 3115
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: WindowWatcher plugin - v0.0.1

Post by kgschlosser » Wed Aug 23, 2017 3:12 pm

thats fine. why not do this. see if you can combine the benefits of using the DLL and add the window class stuff to it.
If you like the work I have been doing then feel free to Image

User avatar
Boolean263
Plugin Developer
Posts: 81
Joined: Sat Aug 12, 2017 7:52 pm
Location: Ottawa, Canada
Contact:

Re: WindowWatcher plugin - v0.0.1

Post by Boolean263 » Sun Aug 27, 2017 10:44 pm

kgschlosser wrote:thats fine. why not do this. see if you can combine the benefits of using the DLL and add the window class stuff to it.
I had a bit of time recently, so I decided to give this a shot. I present, for your perusal, TaskMonitorPlus. I copied the Task Monitor plugin from EventGhost, and added payloads to the window events, similar to the ones in WindowWatcher. Please let me know what you think!
Windows 10 Home, version 1703, build 15063.540 · EventGhost 0.5.0-rc4 · wxPython 3.0.2.0
Python programmer for fun and profit. Dabbler in EventGhost plugin writing. Wiki gardener. General geek.

User avatar
kgschlosser
Site Admin
Posts: 3115
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: WindowWatcher plugin - v0.0.1

Post by kgschlosser » Mon Aug 28, 2017 1:45 am

suggestion also add the dll as well as the source for the dll on you github page
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 3115
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: WindowWatcher plugin - v0.0.1

Post by kgschlosser » Mon Aug 28, 2017 2:08 am

the version you are using is 1.0.4.1

versioning is done as major.minor.micro
micro being for bug fixes thing of that nature
minor for minor changes
major for major changes


what I would honestly do. is I would change the plugin class name the action names and give it a new GUID as well with only you as the author with a mention in the description about bitmonster or you can include him in the author line if you like. set the version to 0.1b and package the thing as your own version of the plugin. you can include checking in your plugin to make sure both are not running at the same time simply by adding the following code to you start routine.

Code: Select all


for plugin_info in eg.pluginList:
    if plugin_info.guid == "{D1748551-C605-4423-B392-FB77E6842437}":
        eg.PrintNotice(
            'You cannot have the original Task Monitor and this plugin installed at the same time.\n'
            'Please uninstall the original Task Monitor.'
        )
        return

now you can also add a notification routine so that it will check and make sure that the other one does not get installed while this one is running as well. by adding the following code to the plugin

Code: Select all

def __init__(self):
    eg.Bind("NodeAdded", self._NodeAdded)
    eg.Bind("NodeDeleted", self._NodeDeleted)

def __close__(self):
    eg.Unbind("NodeAdded", self._NodeAdded)
    eg.Unbind("NodeDeleted", self._NodeDeleted)

def _NodeDeleted(self, (node, parent)):
    if isinstance(node, eg.document.PluginItem):
        if node.info.guid == "{D1748551-C605-4423-B392-FB77E6842437}":
            eg.PrintNotice('Original Task Monitor was removed starting back up.')
            self.__start__()

def _NodeAdded(self, (node, pos)):
    if isinstance(node, eg.document.PluginItem):
        if node.info.guid == "{D1748551-C605-4423-B392-FB77E6842437}":
            eg.PrintNotice(
                'You cannot have the original Task Monitor and this plugin installed at the same time.\n'
                'Please uninstall the original Task Monitor.\n'
                '%s is shutting down.' % self.name
            )
            self.__stop__()
    
If you like the work I have been doing then feel free to Image

User avatar
Boolean263
Plugin Developer
Posts: 81
Joined: Sat Aug 12, 2017 7:52 pm
Location: Ottawa, Canada
Contact:

Re: WindowWatcher plugin - v0.0.1

Post by Boolean263 » Mon Aug 28, 2017 1:48 pm

kgschlosser wrote:what I would honestly do. is I would change the plugin class name the action names and give it a new GUID as well with only you as the author with a mention in the description about bitmonster or you can include him in the author line if you like. set the version to 0.1b and package the thing as your own version of the plugin. you can include checking in your plugin to make sure both are not running at the same time simply by adding the following code to you start routine.
Darn. I kept the GUID the same because I was kind of hoping you'd like what you saw enough to want to merge it. (: Ah well. Thanks for looking over it for me! Thanks also for the tips on checking for other plugins, but if I change the GUID I won't need to worry about that any more. I don't think there's a reason the two plugins couldn't coexist (it would just be redundant, that's all).
kgschlosser wrote:suggestion also add the dll as well as the source for the dll on you github page
I don't really see the need. I didn't write the DLL, nor did I change anything in it. This plugin will work fine without it for as long as EventGhost ships with its own Task Monitor plugin which includes the DLL.
Windows 10 Home, version 1703, build 15063.540 · EventGhost 0.5.0-rc4 · wxPython 3.0.2.0
Python programmer for fun and profit. Dabbler in EventGhost plugin writing. Wiki gardener. General geek.

User avatar
kgschlosser
Site Admin
Posts: 3115
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: WindowWatcher plugin - v0.0.1

Post by kgschlosser » Mon Aug 28, 2017 2:43 pm

see well that is the thing. we are trying to eliminate the shipping of EG with the plugins in favor of making a plugin repository. hence the .egplugin package which makes it easier to manage this. that is why I am making these suggestions. + if we do decide to keep plugins shipped and if we wanted to add yours since the inability to have both the task monitor and the task monitor plus running at the same time we would remove the original and since your plugin relies on a file that is no longer there it would no longer function.

we are very much for improving existing plugins but the changes you made are great. I am not the person that decides what changes get added. so what you would have to do to get that done is you would have to make a fork of the EventGhost repository create a branch on your fork for the changes you want to make. code in the changes to that branch and then submit that branch as a pull request to the EventGhost repository. always create a new branch for each change and make sure that you update the fork (sync it with the EventGhost repository) to make sure it is up to date so you do not make any modifications that could rely on code that has been changed.

I am not sure how well you know GitHub but if you need some help I can walk you through what to do. I am personally a GitIdiot i know enough to cause problems :D but I will do my best to help ya out if ya need it.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 3115
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: WindowWatcher plugin - v0.0.1

Post by kgschlosser » Mon Aug 28, 2017 2:44 pm

and that is ok about not writing it, that is why it is ery important that you have the header on the tops of the file that states it is ok for you to modify and or redistribute the code.
If you like the work I have been doing then feel free to Image

User avatar
Boolean263
Plugin Developer
Posts: 81
Joined: Sat Aug 12, 2017 7:52 pm
Location: Ottawa, Canada
Contact:

Re: WindowWatcher plugin - v0.0.1

Post by Boolean263 » Tue Aug 29, 2017 2:00 am

kgschlosser wrote:see well that is the thing. we are trying to eliminate the shipping of EG with the plugins in favor of making a plugin repository. hence the .egplugin package which makes it easier to manage this. that is why I am making these suggestions. + if we do decide to keep plugins shipped and if we wanted to add yours since the inability to have both the task monitor and the task monitor plus running at the same time we would remove the original and since your plugin relies on a file that is no longer there it would no longer function.
I don't seem to have made myself clear in my last post, so let me try again. The only reason my version won't work with the stock version is that I used the same GUID. You're asking me to change my GUID, so that means this problem goes away, and my version can coexist with yours peacefully. You won't have to remove the original for my sake.

And even if you did decide to include my work, you wouldn't have to remove the old plugin. My work was meant specifically to be an enhancement of the existing plugin, not a replacement of it. It still uses most of the same code, I've just changed a few aspects of it. I only presented it as a stand-alone plugin because I didn't want to fork/clone the entire EventGhost git tree for this one thing.

Does that help at all?

Cards on the table: I don't know how to recompile the DLL, and I haven't even looked at its source code. The DLL you have right now with the default plugin does everything I could want. So, while I can include the DLL in my git tree, I won't be to do anything to fix it if it stops working. Not until I learn more about Windows programming. (Which is something I do plan on learning -- that's another reason I took up EventGhost plugin development -- but in the meantime, if anything goes wrong, the users will be honked.)

Do you know when the plugins will be removed from the main EventGhost distribution? I'm assuming that it'll be in 0.6 or later, since 0.5 is on its fourth release candidate. That would be a pretty big change this close to full release.
kgschlosser wrote:[github documentation elided]
I am not sure how well you know GitHub but if you need some help I can walk you through what to do. I am personally a GitIdiot i know enough to cause problems :D but I will do my best to help ya out if ya need it.
I'm grateful for the detailed description you gave on github development. That said, could you please give me a little credit? (: All of my plugins so far have been released on github, and I've demonstrated my familiarity with pull requests with your contributions to the TrayTip plugin. (And based on those, I don't believe that you're a GitIdiot. (: )

If you really think my contributions could be useful to the EventGhost core, then I'm sincerely flattered! I'll certainly consider it. I didn't want to presume anything, since I am still fairly new to the code base. Writing plugins has been a good way to ease myself into it.

Thank you again for all your helpful tips and feedback!
Windows 10 Home, version 1703, build 15063.540 · EventGhost 0.5.0-rc4 · wxPython 3.0.2.0
Python programmer for fun and profit. Dabbler in EventGhost plugin writing. Wiki gardener. General geek.

User avatar
kgschlosser
Site Admin
Posts: 3115
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: WindowWatcher plugin - v0.0.1

Post by kgschlosser » Tue Aug 29, 2017 4:08 am

Boolean263 wrote:. That said, could you please give me a little credit?
i'm sorry. I completely forgot about me doing the PR's for your plugin. otherwise I would not have said that. Call it informational for anyone else that may read this and didn't know how the process works.

And sure any modifications and or suggestions/ideas are very much needed. some may get added and some may not. and some we might ask to be changed a bit. Hell I have quite a few PR's that have been sitting there collecting dust LOL. There are a lot of things I have made and gotten scrapped but i get an education every time so it is never a loss.

and updating a plugin to give better functionality is a great thing and can be handled 1 of 2 ways. repackaged and called a plus version. or it can be a direct modification of the original. I personally like the plus variety because the user can then decide which they want to use. but with the plugin repo coming soon depending on a dll that is contained in another plugin that may not be there is not such a good idea. that is the only reason to package the dll with yours. you do not have to package the source for it. it was a suggestion so that if someone forked your plugin then they could make changes to the source if they wanted to.

I do want to ask how much experience/knowledge do you have with computers/programming. I ask this as not to make a dumbass statement like i did before. I do not like to talk over anyone's head at all. and nor do i want to go through how to write the ABC's when you have already written a novel.
Boolean263 wrote:The only reason my version won't work with the stock version is that I used the same GUID. You're asking me to change my GUID, so that means this problem goes away, and my version can coexist with yours peacefully.
this is not 100%. the GUID is not the only thing. the plugin class name will also clash. because you cannot have 2 plugins for eg.plugins.Task. the last one loaded would be the one that would work.
If you like the work I have been doing then feel free to Image

User avatar
Boolean263
Plugin Developer
Posts: 81
Joined: Sat Aug 12, 2017 7:52 pm
Location: Ottawa, Canada
Contact:

Re: WindowWatcher plugin - v0.0.1

Post by Boolean263 » Tue Aug 29, 2017 11:11 am

kgschlosser wrote:i'm sorry. I completely forgot about me doing the PR's for your plugin. otherwise I would not have said that. Call it informational for anyone else that may read this and didn't know how the process works.
No worries, I wasn't offended. (: You're right, it does make a good guide for other people too.
kgschlosser wrote:but with the plugin repo coming soon depending on a dll that is contained in another plugin that may not be there is not such a good idea. that is the only reason to package the dll with yours. you do not have to package the source for it. it was a suggestion so that if someone forked your plugin then they could make changes to the source if they wanted to.
That makes perfect sense. I'm just uncomfortable with it because, like I say, I wouldn't know how to fix it if something went wrong with it. But I am willing to learn.
kgschlosser wrote:I do want to ask how much experience/knowledge do you have with computers/programming. I ask this as not to make a dumbass statement like i did before. I do not like to talk over anyone's head at all. and nor do i want to go through how to write the ABC's when you have already written a novel.
Like you said, even if I don't need the information you're typing, it's good for other people coming by who might not be as comfortable with it as I am. Don't be afraid to be verbose. I'm sorry I lost my cool last night, it wasn't called for.

I've been programming for most of my adult life, so I'm pretty comfortable with the Python side of things, as well as software design/development/engineering in general. My system-specific experience has been with Linux, though. All my jobs have been Linux-based, and Linux makes it so easy since it practically ships with compilers and system tools and whatnot. EventGhost is my first foray into writing programs that interact with Windows-specific APIs. And now, I need/want to learn how DLLs work from the inside, so I don't feel so dumb and helpless if something goes wrong with TaskHook.dll.
kgschlosser wrote:this is not 100%. the GUID is not the only thing. the plugin class name will also clash. because you cannot have 2 plugins for eg.plugins.Task. the last one loaded would be the one that would work.
Then I'll change the class name too. Easy peasy. (: We should also document that somewhere. I haven't gotten off my duff to work on the wiki yet, but that seems like a good place for this sort of information.
Windows 10 Home, version 1703, build 15063.540 · EventGhost 0.5.0-rc4 · wxPython 3.0.2.0
Python programmer for fun and profit. Dabbler in EventGhost plugin writing. Wiki gardener. General geek.

User avatar
kgschlosser
Site Admin
Posts: 3115
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: WindowWatcher plugin - v0.0.1

Post by kgschlosser » Tue Aug 29, 2017 2:01 pm

kgschlosser wrote:We should also document that somewhere. I haven't gotten off my duff to work on the wiki yet, but that seems like a good place for this sort of information.

We do need to document that. Me being the old fart that I am, I do not remember if I have already told you the process of adding things to the wiki. so I am going to ask if i did that way you won't start throwing crackers at me and call me "Polly". (parrot joke for those of you that do not understand).

The documentation is something that has been lacking and we do know it needs to be improved.

But..... I have a very special project I am working on. And it is an area I have done some work with way back when feet was used as fuel in your car. :shock:
We have been forced to move our website (godaddy sucks!) and I have secured a VPS. I have been putting together the process to move the site to said VPS. There are some things I have yet to complete but our timetable has moved doe to some other things that just came about. so the sooner we can move the better. I think that if you are able to help me with this. the process would be a whole lot less painless for me. As much as I would like to learn the bits and pieces I have not yet managed to get to I do not know if there will be ample time to learn it as I go (usually breaks things). I could use the hand if you are willing.

This is what we have.

4 cores at 2.3 ghz (dedicated)
4 gig ram (dedicated)
150 gig SSD (dedicated space allocation on a shared SSD stripe)
1000 mbit connection
10tb of bandwidth


software



New server update.

Postby kgschlosser » Wed Jun 28, 2017 5:17 am
OK this is where I am at thus far

Ubuntu 16.04
Apache 2.4
PHP 7.1
PHP Caching
MySQL 5.7
PHPMyAdmin
MediaWiki 1.28.2
PHPBB 3.2
Webalizer
Firewall
FTP
SSH
SFTP
ACL

need to do during the move process:

Migrate MediaWiki SQL database
Migrate PHPBB (Forum) database
Convert MediaWiki database to support 1.28.2
Convert PHPBB database to support 3.2
Migrate Website
Set up test site
set up dial instances of mysql

there are other things as well. but those are the biggies and most of it I have already done. I could use someone that would be able to tweak it and help with the things I do not know how to set up.
I have a lot of it done. and when I mean done I have most of a script written so I can do a clean install of the OS and then run the script.
I made a python script to connect to the old site and recursively download everything including backing up the databases.

If you are willing it would be a HUGE help. send me a PM if you are interested.
If you like the work I have been doing then feel free to Image

User avatar
topix
Experienced User
Posts: 381
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: WindowWatcher plugin - v0.0.1

Post by topix » Sat Sep 02, 2017 8:42 am

If this plugin is 100% compatible with the current task plugin and only adds extra stuff, then i would see it as an update and stay with the GUID.

Post Reply