ShawnJustShawn
8 discussion posts
Trying to see if it's possible to trigger or script based on a Window changing in some way.
Short term / small reason : I want to simply highlight Slack if it updates in anyway to improve visibility since the notifications are not the best. The contents of the window obviously change a little when an update happens since there are unread message tags. But also the taskbar changes as well (windows 10) because it updates the badge with an unread count.
Bigger reason : I think it would be very helpful to combine window changes with the script Thomas wrote "Actively Dim Unfocused Windows" to something that Dims all windows until they have been updated in some way after they are out of focus. Or a non dimming script that just highlights any windows that have been updated since they lost focus. I think it would be helpful on the large screen to see when the windows have been updated. (Outlook, chat apps, network monitors etc.)
I did a handful of searches in the discussion and didn't find an obvious answer.
Thanks for any answers or ideas. -S
Unfortunately this wouldn't really be possible to do. The only reliable way to detect when a window changes would be to monitor for WM_PAINT messages, but applications repaint themselves a lot, so the Trigger would just be constantly firing.
Sorry!
ShawnJustShawn
8 discussion posts
Thanks Keith,
Ah. Makes sense but of course disappointing.
Is there any ability to watch for "SetOverlayIcon" that happens on the task bar? From what I understand when nothing is present the value is Null. If there was some way to highlight a window based on the overlay icon being not equal to null maybe?
https://msdn.microsoft.com/en-us/library/windows/desktop/dd391696%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
Unfortunately I am not a real coder so only making some leaps here. If you think it is possible I can try to piece some things together. But if a lost cause .. won't bother.
-S
ShawnJustShawn
8 discussion posts
HI Thomas,
Really appreciate the reply. I tried it out to partial success. When the function initially runs it pops an alert if it sees the search string has appeared since the last time it had the file open.
But ... it won't pop an alert when a new update is made to the file. In order for it to alert again I have to close the function and re-run it.
Along the same line, if the file has not been updated and the function is started it will not pop on any new updates.
Seems like either the file watcher isn't notifying the function of an update on the fly or the function isn't looping properly ?
My understanding of C is a bit rudimentary at best.
Any ideas? I tried making a few changes to the breaks and reviewed things but didn't have any luck yet.
Thanks again -Shawn