D
D
dinaff2019-10-21 20:31:26
API
dinaff, 2019-10-21 20:31:26

How or what message to send to move one window over another?

I'm practicing in WinApi and I have a task to implement the movement of one window by moving the pressed cursor in the client area of ​​another window .
In the first window, movement is implemented when the mouse is held down in the client area as follows:

case WM_LBUTTONDOWN:
    {
        flag = true;
        break;
    }
case WM_MOUSEMOVE: {
    if (flag) {
      ReleaseCapture();
      SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0);
    }
    break;
  }

Is there any way to make this work when sending messages to the first window from the second window? If yes, how to do it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question