Home » Community » Newbie corner » Drag of mouse while left button is pressed.
Re: Drag of mouse while left button is pressed. [message #27639 is a reply to message #27628] |
Tue, 27 July 2010 12:11  |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
The code you want is something like:
void LeftDown(Point p, dword keyflags)
{
SetCapture();
// All mouse events are now directed to this ctrl until ReleaseCapture is called
}
void MouseMovePoint p, dword keyflags)
{
if (HasCapture())
// Left mouse is depressed
else
// No button pressed
}
void LeftDown(Point p, dword keyflags)
{
ReleaseCapture();
}
There are loads of other ways of doing it, but this is the cleanest for simple behaviour. You can also use LeftHold/LeftDrag but they have a slight delay before being triggered.
|
|
|
Goto Forum:
Current Time: Sun Jun 22 15:59:10 CEST 2025
Total time taken to generate the page: 0.04272 seconds
|