Skip to main content
GameDev.net gamedev.net
🔒 Locked

Win32 CHange Window Position and Resizing Window?

Started by nuclear123 Jan 15, 2012 at 8:19 PM 2 replies 2.1k views
Original Post
nuclear123
nuclear123
Does win32 offer 2 seperate functions for the following?
1.) Resize a specified window
2.) Move a specified window

All i can seem to find is MoveWindow() which performs both actions at once and this is not what im looking for. Thanks!
jwezorek
jwezorek

Does win32 offer 2 seperate functions for the following?
1.) Resize a specified window
2.) Move a specified window

All i can seem to find is MoveWindow() which performs both actions at once and this is not what im looking for. Thanks!

Not really but you can write them yourself pretty easily e.g.

void MoveWindowToXy( HWND wnd, int x, int y) {
RECT r;
GetWindowRect( wnd, &r );
MoveWindow(wnd, x, y, r.right-r.left, r.bottom-r.top, FALSE);
}

Not sure how you would want to set up a pure resize function that is different than the MoveWindow() API call.
Endurion
Endurion
SetWindowPos does what you're looking for. Using the flags SWP_NOMOVE or SWP_NOSIZE you can control which parts of the call are actually done.
Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.