Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5953695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:51:46+00:00 2026-05-22T17:51:46+00:00

I need to implement mouse drag events which look something like this: class MouseDragEvent

  • 0

I need to implement mouse drag events which look something like this:

class MouseDragEvent
{
public:
   uint m_btn;
   uint m_x, m_y;
   uint m_delta_x, m_delta_y;
};

I think I will need to check for WM_LBUTTONDOWN and WM_LBUTTONUP messages and manually find the change in x and y. Is there a drag message or a better way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:51:47+00:00Added an answer on May 22, 2026 at 5:51 pm

    Start by detecting WM_LBUTTONDOWN. Record the starting coordinates where the mouse button was pressed. Check for WM_MOUSEMOVE, and when the mouse has moved outside the rectangle determined by GetSystemParameters(SM_CXDRAG) and GetSystemParameters(SM_CYDRAG) use SetCapture to capture the mouse. At this point continue responding to WM_MOUSEMOVE and check for WM_LBUTTONUP. You might want to change the mouse cursor at this point. Also check for WM_CAPTURECHANGED, which means the drag has been aborted. After the drag is complete call ReleaseCapture.

    Edit: Most of this process can be automated with the DragDetect function. Call this function from the WM_LBUTTONDOWN handler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to implement a drag and drop functionality, where I can define and
I have a need to implement a rating feature and would like to do
I would implement the view moving, I just need to know if the mouse
I need some help to implement this roll over / out effect. This is
I need to implement a scroll view which (on a button press) will page
I need to implement cross platform handler for the removable media mount/umount events. It
We need to implement a search filter (Net-log like) for my social networking site
i need to implement this layout in android..the view must be have two list
I need to implement a operation in which the user requests a file which
I need to implement a Diff algorithm in VB.NET to find the changes between

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.