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. Alternative to SetCursorPos?

Alternative to SetCursorPos?

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
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.
  • Z Offline
    Z Offline
    Zee man
    wrote on last edited by
    #1

    I have 2 MS paintbrush applications side by side. I want to duplicate the brush strokes of one paintbrush on the other. I do this by installing a dll WH_GETMESSAGE hook on the 1st paintbrush and detect WM_MOUSEMOVE and LBUTTONUP/DOWN events. But how to duplicate it on the 2nd paint app? If i do setCursorPos the mouse moves away from the control of the artist. And sending a PostMessage(WM_MOUSEMOVE,x,y) to the 2nd paint doesn't seem to work. Is there any way to simulate a mouse move without taking the mouse away from the user? Need Help. thanks.:confused: Regards, Zee man

    B 1 Reply Last reply
    0
    • Z Zee man

      I have 2 MS paintbrush applications side by side. I want to duplicate the brush strokes of one paintbrush on the other. I do this by installing a dll WH_GETMESSAGE hook on the 1st paintbrush and detect WM_MOUSEMOVE and LBUTTONUP/DOWN events. But how to duplicate it on the 2nd paint app? If i do setCursorPos the mouse moves away from the control of the artist. And sending a PostMessage(WM_MOUSEMOVE,x,y) to the 2nd paint doesn't seem to work. Is there any way to simulate a mouse move without taking the mouse away from the user? Need Help. thanks.:confused: Regards, Zee man

      B Offline
      B Offline
      Budric B
      wrote on last edited by
      #2

      I have never done this but here's a thought... Use CWnd* myWnd = CWnd::FindWindow(NULL, _T("Paint2")); myWnd->PostMessage(..) and send all the mouse movement messages that you receive to the other window. It may work, it may not.

      Z 1 Reply Last reply
      0
      • B Budric B

        I have never done this but here's a thought... Use CWnd* myWnd = CWnd::FindWindow(NULL, _T("Paint2")); myWnd->PostMessage(..) and send all the mouse movement messages that you receive to the other window. It may work, it may not.

        Z Offline
        Z Offline
        Zee man
        wrote on last edited by
        #3

        Thats what I said I did and but it doesn't work. If I just filter out mousemove, lbuttonup and lbuttondown and postmessage those, VC spy says the destination paint is getting them but nothing draws on the paint area. If I send all mouse events then the detination paint just hangs up. I'm stuck. Regards, Zee Man

        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