Jump to content

ThomasRiedelDk

Members
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. ThomasRiedelDk

    Simulate mousedrag

    Thanks. You are right. The resize area in the Top bar is quite large, and I was not aware that it even existed.
  2. ThomasRiedelDk

    Simulate mousedrag

    Right you are. Actually I did not even know, that forms were resizable from the top. I tried var dy := (Height - ClientHeight) div 2; It works as well. Thanks
  3. ThomasRiedelDk

    Simulate mousedrag

    Thanks for the reply, but it did not help, - still resizing the form. And the cursor turns into updown arrow shape.
  4. ThomasRiedelDk

    Simulate mousedrag

    It was just meant to slow down the process a bit.
  5. ThomasRiedelDk

    Simulate mousedrag

    Sleep does nothing, and that is intended..
  6. ThomasRiedelDk

    Simulate mousedrag

    I have this code, that simulates a mouse drag, moving the form: procedure TForm1.SimulateMouseDrag(FromX, FromY, ToX, ToY: Integer); begin SetCursorPos(Fromx, Fromy); mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); // Simulate mouse down sleep(100); mouse_event(MOUSEEVENTF_MOVE, ToX-FromX, ToY-FromY, 0, 0); // Simulate mouse move sleep(100); SetCursorPos(Tox, Toy); mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); // Simulate mouse up end; procedure TForm1.Button1Click(Sender: TObject); begin SimulateMouseDrag(left+5, top+5, left+200, top+200); end; It works, but the form shrinks during the operation. What am I missing?
×