To receive notifications about all windows, and not just in Windows Forms, you will need to use the set of hooks specified by the SetWindowsHookEx () API function. You will need a WH_CALLWNDPROC hook so you can see the WM_MOVE message that Windows sends to the window.
Unfortunately, this is a global hook. Code that implements a hook callback must be packaged in a DLL so that it can be embedded in all target processes. This breaks the hole in your plans to use C # for this, you cannot enter the CLR. DLL must be written in unmanaged code.
This one offers an approach, including the unmanaged injection DLL you need.
source share