Monitor a window title and trigger action on change (Windows)

I already found out how to get the window title of a certain process and save it to a file with the following cmd:

tasklist /fi "imagename eq process.exe" /fo list /v | find "Window Title" > "c:usersxxxxxdesktop123.txt"

My actual goal is to monitor the window title of this process and – when it changes – trigger a curl request like this

curl -X POST "http://192.168.x.xxx/json/state" -d "{Window Title}" -H "Content-Type: application/json"

I’m not very versed with this and so I would be happy if someone could help me.