-
February 27th, 2012, 09:45 AM
#1
Click and hold/drag
Hey everyone.
So i have a grid in my program that i want the user to be able to click and drag items around.
Im using the CALLBACK WindowProc to handle my mouseclicks at the moment, but that can only handle a click at one location (as far as i can work out). Is there an easy way to simulate click and hold and click and dragging? Maybe a way to constantly keep getting the mouse location that i dont know of?
Thanks,
M
-
February 27th, 2012, 09:56 AM
#2
Re: Click and hold/drag
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky
-
March 1st, 2012, 01:50 PM
#3
Re: Click and hold/drag
Thanks for your reply, sorry its taken me so long to get back to you on this.
Im kinda rubbish with c++, but .net especially. Im not too sure how WM_MOUSEMOVE works. Say you wanted to just click and item and drag it across the screen, would you need a while loop constantly checking the co-ordinates?
Would you be able to provide some reading or sample code to describe how its used?
Thanks for your help either way,
M
-
March 1st, 2012, 05:06 PM
#4
Re: Click and hold/drag
When the mouse moves you get a message. Process the message. If the mouse is "continuously" moving, you will get the message repeatedly. The message also tells you what mouse buttons are pressed (if any), and whether the CTRL or SHIFT keys are pressed.
No need to constantly check coords. They are passed to you in the message.
Viggy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|