locked
Mouse update frequency RRS feed

  • Question

  • I'm rebuilding an app I wrote 10 years ago with the win32 api.  In it I had an image that was updated whenever the mouse moved over it.  My problem with the port is that it only seams to update the mouse position when the user stops moving the mouse and therefore I can't properly update the visual referances in the image as the mouse is moveing.  I'm displaying the image in a PictureBox on an form that is an MDI client.  I have tried setting up a timer to get the mouse info and update that way but so far it keeps returning the same position untill the mouse stops moving.  If anyone knows where I can find a solution please let me know.

    Sunday, May 15, 2011 6:02 AM

Answers

  • Opps, I did it again... Just call me Britny...

    What did I do you ask... Simple, I spent all day working on a problem got frustrated posted a question about it then left got dinner went home relaxed a bit and before calling it a night I looked to make sure my notes were up to date and decided to make a quick little change... And the problem went away! :)  Happens 8 out of 10 times I post a question!

    So, for anyone wondering the problem is that I was updateing the image in the mouse move event handler.  I moved it to the on paint function of the picture box then invalidated the picture box from the mouse move handler.

    Don't know why it does it but updateing the image in mouse move event of the picture box causes the entire form to stop responding to events till the mouse stops moving.  Which is why it wasn't updateing in the timer function I created because it wasn't calling the timer event again till the mouse stopped moving... I could literly "FREEZE" the form and all event handling for as long as I kept the mouse moving.


    • Marked as answer by Kalmith Sunday, May 15, 2011 8:46 AM
    • Edited by Kalmith Sunday, May 15, 2011 8:49 AM typo's and clarity
    Sunday, May 15, 2011 8:46 AM