How can SetCapture() get the collar coordinates?



  • How do you get the cadet's coordinates through winapi if it's outside the screen? I've been advised to use SetCapture, but I don't understand by reading the description how it works. https://ru.stackoverflow.com/questions/541216/%d0%9a%d0%b0%d0%ba-%d0%bf%d0%b5%d1%80%d0%b5%d0%bc%d0%b5%d1%81%d1%82%d0%b8%d1%82%d1%8c-%d0%be%d0%ba%d0%bd%d0%be-%d0%b5%d1%81%d0%bb%d0%b8-%d0%ba%d1%83%d1%80%d1%81%d0%be%d1%80-%d0%b2%d1%8b%d1%85%d0%be%d0%b4%d0%b8%d1%82-%d0%b7%d0%b0-%d0%b5%d0%b3%d0%be-%d0%bf%d1%80%d0%b5%d0%b4%d0%b5%d0%bb%d1%8b-%d0%bd%d0%b0-winapi

    I need coordinates to move a window with a non-standard interface. I added the SetCapture code, but it didn't do anything. The code is like this:

    case WM_MOUSEMOVE:
      SetCapture ( hwnd );
      WmMouseMoveX = GET_X_LPARAM ( lParam );
      WmMouseMoveY = GET_Y_LPARAM ( lParam );
    

    // здесь код, перемещающий окно с помощь SetWindowPos()
    ...

    ReleaseCapture ( );
    break;



  • Use GetCursorPos: https://msdn.microsoft.com/ru-ru/library/windows/desktop/ms648390(v=vs.85).aspx In the description of the functions, there are councils for application in the case of multiple desctops.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2