I need to watch an app written in c++ and know when it moves so my c# windows form app can move with it.
I can poll the c++ app’s position with a timer but want a better solution.
How can I watch the windows messages for the one app to see if it is moved?
Can it be done?
Or will I need to find a C++ dll to do it or have one written?
You can use SetWindowsHook and the WH_CBT hook which will notify you went the window moves.
See How to set a Windows hook in Visual C#. or p/Invoke.net