Advertisement

Change notifier for a window?

Started by December 20, 2010 07:01 AM
7 comments, last by hkBattousai 14 years, 2 months ago
I have a window, I want to be notified when there is any change on it. Regular changes occur only once in a few hours, therefore I can't keep staring it.

Is there any tool for this? A tool which will notify me in some way, when there is any change on a window (even if it is a single pixel)?
Is the window always visible on screen, or is it minimized or partially/fully obscured by other windows?
Advertisement
I'm not 100% sure of this, but let me take a stab at it...

Assuming you're using Windows, and are willing to hack together a quick program, something like this might be possible to implement using hooks. You're probably interested in intercepting the WM_PAINT message whenever the target window receives it (you can find the window handle using Spy++ if you have a non-Express version of Visual Studio, or look for an alternative).

If you're willing to do this, you can start by reading about the SetWindowsHookEx() function.
The window is minimized. Not visible all the time.

Actually, I'm trying to catch a cat... The cat come near the window, enters a cage and eats the bait in it. I set up a webcam to capture the cage. I want to be notified when there is a change in the image, so that I can pull the string that is tied to the door of the cage.

I'm serious about this...
You suck at building traps. Watch more Scooby Doo or buy a medium sized animal trap which has a pressure sensor.
Minimized windows typically do not paint. If you're capturing from a video capture device, consider capturing with your application and run some pattern recognition on it.

To make it is hell. To fail is divine.

Advertisement
Quote:
Original post by hkBattousai
The window is minimized. Not visible all the time.

Actually, I'm trying to catch a cat... The cat come near the window, enters a cage and eats the bait in it. I set up a webcam to capture the cage. I want to be notified when there is a change in the image, so that I can pull the string that is tied to the door of the cage.

I'm serious about this...


Sounds fun!

Motion detection... OpenCV springs to mind. It can communicate with your webcam, analyze its output and inform you of any changes.

Try something like this: Motion detection using OpenCV.

[OpenTK: C# OpenGL 4.4, OpenGL ES 3.0 and OpenAL 1.1. Now with Linux/KMS support!]

Quote:
Original post by Sirisian
You suck at building traps. Watch more Scooby Doo or buy a medium sized animal trap which has a pressure sensor.


Agreed. I would recommend a deadfall trap.
Quote:
Original post by tstrimp
Quote:
Original post by Sirisian
You suck at building traps. Watch more Scooby Doo or buy a medium sized animal trap which has a pressure sensor.


Agreed. I would recommend a deadfall trap.


I made a home made cage trap instead.

This topic is closed to new replies.

Advertisement