Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Moving mouse over the buttons.

Moving mouse over the buttons.

Scheduled Pinned Locked Moved C / C++ / MFC
questiongame-devhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nikz2
    wrote on last edited by
    #1

    Hi. Well.. I am developing a little game and a have this trouble. I want to make the window scroll by clicking and draging. It already works and works fine. But... My map is made of buttons and when i try to move the window by clicking and draging at the buttons positions main window doesn't recive ON_WM_MOUSEMOVE signal. So how can i make my application to generate ON_WM_MOUSEMOVE when i am clicking buttons? Tnx for help.

    _ 1 Reply Last reply
    0
    • N Nikz2

      Hi. Well.. I am developing a little game and a have this trouble. I want to make the window scroll by clicking and draging. It already works and works fine. But... My map is made of buttons and when i try to move the window by clicking and draging at the buttons positions main window doesn't recive ON_WM_MOUSEMOVE signal. So how can i make my application to generate ON_WM_MOUSEMOVE when i am clicking buttons? Tnx for help.

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      When the left mouse button is pressed on a button, the expected behavior is a button click. Do you not want that behavior? Is the button not click-able? If yes, then how do you want it to scroll?

      «_Superman_» I love work. It gives me something to do between weekends.
      Microsoft MVP (Visual C++)

      N 1 Reply Last reply
      0
      • _ _Superman_

        When the left mouse button is pressed on a button, the expected behavior is a button click. Do you not want that behavior? Is the button not click-able? If yes, then how do you want it to scroll?

        «_Superman_» I love work. It gives me something to do between weekends.
        Microsoft MVP (Visual C++)

        N Offline
        N Offline
        Nikz2
        wrote on last edited by
        #3

        Well. Button is clickable, but i want that my main window recive message wm_mousemove instead of button. I solved it a little while ago with

        void MPictureBox::OnMouseMove(UINT nFlags, CPoint point)
        {
        CRect pRect;
        CPoint cp;
        GetCursorPos(&cp);
        this->GetParent()->ScreenToClient(&cp);
        LPARAM lParam = ((cp.y) << 16) + cp.x;
        this->GetParent()->PostMessageA(WM_MOUSEMOVE,nFlags,lParam);

        }

        But anyway thanks =)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups