Resizing a dialog
-
Alright I was going to try and solve this problem on my own, but with school I just don't have the time and its really starting to bug me. Here it is. I want to have a menu item that when selected will change the dimensions of the main dialog. I'd like it to be able to resize the dialog to fit the screen. I'd also like to have a 640x480, 800x600, and a 1024x768 item that when selected will change the dialog to these sizes. I've tried using MoveWindow(), but this only seems to work in the dialogs initialization. I'd like to solve this myself, but it's gotten to the point that not having the answer is too annoying. Thank you.
-
Alright I was going to try and solve this problem on my own, but with school I just don't have the time and its really starting to bug me. Here it is. I want to have a menu item that when selected will change the dimensions of the main dialog. I'd like it to be able to resize the dialog to fit the screen. I'd also like to have a 640x480, 800x600, and a 1024x768 item that when selected will change the dialog to these sizes. I've tried using MoveWindow(), but this only seems to work in the dialogs initialization. I'd like to solve this myself, but it's gotten to the point that not having the answer is too annoying. Thank you.
Use SetWindowPos() to set the position and size of the dialog at the same time:
SetWindowPos ( hwndDialog, NULL, 0, 0, nWidth, nHeight, SWP_NOZORDER );
--Mike-- http://home.inreach.com/mdunn/ "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas." --Buffy -
Use SetWindowPos() to set the position and size of the dialog at the same time:
SetWindowPos ( hwndDialog, NULL, 0, 0, nWidth, nHeight, SWP_NOZORDER );
--Mike-- http://home.inreach.com/mdunn/ "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas." --Buffy