is there a way to move a static box allong with the mouse when you click? i need to have it be able to move it like i was dragging it along and placing it in another position. i am useing c++ and the windows api any help would be appriciated
is there a way to move a static box allong with the mouse when you click? i need to have it be able to move it like i was dragging it along and placing it in another position. i am useing c++ and the windows api any help would be appriciated
All Your Base Are Still Belong to Someone!!!
And you Remember that!!!
A... stah... tic... box...?
What do you mean? Do you mean a static control (Set up to be a box), in which case it's a window and you use MoveWindow inside your main window's WindowProc, for the WM_MOUSEMOVE message (The wParam or lParam gives you the details on the mouse, I don't know it off the top of my head, try MSDN).
Or, if you mean a rectangle that you draw yourself (Which would be static if it isn't moving) then you'd just have a global RECT structure and update it with the mouse and it will be drawn in its new position via your (Properly written) WM_PAINT handler.
omg ok, thanks for the input, i was doing it correctly but in the MoveWindow function i had repaint set to 0 so nothing was happening, hahahaha thanks again
All Your Base Are Still Belong to Someone!!!
And you Remember that!!!
ok so is there an easy way to find which window holds the mouse and move only that window? would i use getcapture or what?
All Your Base Are Still Belong to Someone!!!
And you Remember that!!!
Ya.....you can use GetCapture() to determin which window holds mouse....
One another solution to determine on which window mouse is currently moving is to use api WindowFromPoint() . If window you get from this function is same as you static box window then you can move your static box window accordingly.
Chintan R Naik