Jump to content
  • Advertisement
Sign in to follow this  
ouraqt

Dragging and Dropping (nevermind)

This topic is 3569 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
you might want to consider using C++/CLI ("managed c++") so you can leverage .NET for GUI stuff. sure beats MFC, and even MFC beats raw win32.

Share this post


Link to post
Share on other sites
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!