What’s the point of the MoveWindow function when we already have SetWindowPos?

Raymond Chen

Commenter Phil Quirk notes via the suggestion box, “MoveWindow is just a weird function. I guess it’s easier to call than SetWindowPos, but that’s the only thing it seems to have going for it.”

Yup, that’s about right.

The MoveWindow function doesn’t really do anything you couldn’t already do yourself with SetWindowPos. It’s just a convenience function. And it you look at it pretty closely, it’s really not that big of a convenience either, saving you one parameter (hwndInsertAfter) and replacing the flag SWP_NOREDRAW with a boolean parameter.


It shouldn’t take too much imagination to figure out how this situation came about. It’s the same reason why you have both CreateWindow and CreateWindowEx.


Discussion is closed.

Feedback usabilla icon