Is it possible to somehow tie the window of my program to the window of another program?

While I know only about one method, in a while loop, calculate the current coordinates of the window and change the coordinates of my window. But maybe there is an opportunity to receive notifications about a change in the position of a third-party application window via Win_API?

    1 answer 1

    You need to set the parent for your window as another window using the WniAPI function:

    [DllImport("user32.dll", SetLastError = true)] private static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); 
    • Well, the window becomes a child ... as in MDI applications. With all that it implies. And I need my window to be outside, not inside. - iRumba