News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Window Resizing

Started by test, May 04, 2009, 02:00:38 AM

Previous topic - Next topic

test

Hello all :bg I'm new to assembler and I've created a dialog box :U Only problem is that when I resize the window all the controls stay in there spot. They don't reposition them selves to the window. Is there a specific win32 api I can use in my window procedure? Thanks

hutch--

Yes but its not as easy as you think. You can use MoveWindow() or SetWindowPos() but you must track and size the windows yourself. You get the size with API calls like GetClientRect() or GetWindowRect() depending on what you need, calculate the size change then use MoveWindow() to change the size.

There are no API calls that automatically resize controls in a dialog or window.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

UtillMasm

great idea.

[attachment deleted by admin]

test

Wow :green2 Good info. I was hoping for an easier way but I guess I got some reading to do. Thanks Hutch :clap:

peaslee

Unless there is a reason to allow the user to resize a window, I eliminate that possibility with window style settings. I usually just allow minimizing.
Bruce Peaslee
"Reality is a crutch for those who can't do drugs."

Jimg

Boooo.  One of my pet peeves is not being able to resize a window or popup or anything else!

kero

> There are no API calls that automatically resize controls in a dialog or window

But we haveĀ  DeferWindowPos / BeginDeferWindowPos / EndDeferWindowPos

MichaelW

DeferWindowPos is used to reduce the amount of work the system does in moving/resizing multiple windows. The new position and size must still be determined and passed to the function.

http://blogs.msdn.com/oldnewthing/archive/2005/07/06/436043.aspx
eschew obfuscation