Needed: Automatic screenshots on window changes

I can’t find windows software anywhere that will attach to a window/process, and automatically take a screenshot of that window (or child windows) every x seconds or whenever a change is detected. If the attached-to app is running and a progress bar in it updates, or a confirmation popup appears, or the text in that window changes, or an error occurs… I want an app to tell me when that change occurred (from the time I started recording) and what it looked like (screenshot).

Bonus points if I don’t have to have the attached-to app visible/on screen… like I can have other windows on top of it, and the “on change” detection & screenshots still work.

If the “on change” part just isn’t possible, then “every x seconds” would be ok, I guess. Can’t find this anywhere. Anybody know of an app for this?