Sign in to follow this  
ouraqt

Dragging and Dropping (nevermind)

Recommended Posts

ouraqt    236
I'm working on a simple 3D modeler. I'm not new to programming, but sometimes my Win32 prowess is a bit rusty. So anyway, I want to implement a kind of drag-and-drop functionality for something (just clicking on an object and dragging it somewhere). This is a simple matter of mouse input. The problem: I can detect when the user clicks on an object by capturing the WM_LBUTTONDOWN message. No problem. But at some point I need to detect when the user releases the mouse button, presumably with WM_LBUTTONUP, right? Well, that's what I was doing. But Windows doesn't guarantee that it will always send me a WM_LBUTTONUP after a WM_LBUTTONDOWN message. For example, if the users clicks, moves the cursor outside the window, then releases, I don't get a WM_LBUTTONDOWN message!! Is there a simple way to detect when the user releases a mouse button, even if the cursor was dragged outside the window? Oh, and I'm using C++, but it shouldn't really matter because this is just generic win32 programming. Thanks! EDIT: It looks like I need to use SetCapture to capture mouse input. Lame-sauce. I'll take it from here. Thnx anyway.

Share this post


Link to post
Share on other sites
ouraqt    236
That requires that users have the .NET runtime installed, right? Is it a good idea to make that assumption? (I think I know a bunch of folks with WinXP sp 1, no .NET)...

Then again, it IS a 3D modeler. The user is expected to have a decent machine.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this