Updating textbox

Hi,

I am having problems with some code and need help. I have a function that gets the position of the mouse and stores the value into 2 doubles. This function is always running and i know it works. I am trying to make a textbox using windows that will print the double to the screen. How do i make it so that the text will update as i move the mouse?

Thanks
The updating of the user interface in windows is a low priority - (the WM_PAINT is a low
priority message) - so trying to update visual element while the processor is thrashing around running a very tight loop does not work well.
Also it can be jumpy - by that I mean you don't get multiple WM_PAINT messages in the message queue - they are amalgamated and you just get one message.

In the case of wanting to display the mouse position on a mousemove - then trap the WM_MOUSEMOVE message and update the editbox there.
((No matter how fast the user can move the mouse it is still slow as far as the computer is concerned so there is plenty of time for all the updates to get done.))

Example:

1
2
3
4
5
6
7
     case WM_MOUSEMOVE:
        {
            std::stringstream ss; 
            ss << LOWORD(lParam) << " :" << HIWORD(lParam);
            SetWindowTextA(edit1,ss.str().c_str());
            return 0;
        }



Topic archived. No new replies allowed.