News:

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

Buttons don't move with SW_MAXIMIZE

Started by hfheatherfox07, August 31, 2011, 10:14:36 PM

Previous topic - Next topic

hfheatherfox07

Hi,
I was wondering what command can I use to have the buttons move position relative to the window size when the window gets maximized?
also is there such command in the rsrc.rc with ReSED?

Thank you....

qWord

hi,
It is your job to move/size the controlls if wished.
FPU in a trice: SmplMath
It's that simple!

hfheatherfox07

Quote from: qWord on August 31, 2011, 10:39:03 PM
hi,
It is your job to move/size the controlls if wished.

Not aware of how to do that ....
I found http://win32assembly.online.fr/tut9.html

invoke CreateWindowEx,NULL, ADDR ButtonClassName,ADDR ButtonText,\
                        WS_CHILD or WS_VISIBLE or BS_DEFPUSHBUTTON,\
                        75,70,140,25,hWnd,ButtonID,hInstance,NULL
mov  hwndButton,eax


is this what you mean ? or is there another way ....
the reason that I am asking is that ...this example is a bare bones thing .... eventually I will be making a vista skin window with image buttons

Gunner

MoveWindow, SetWindowPos come to mind...
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

hfheatherfox07

Quote from: qWord on August 31, 2011, 10:39:03 PM
hi,
It is your job to move/size the controlls if wished.

Just had a thought .....

is there a way to move the controls relative to a fix potion , other wise would it not appear different on each computer screen? would I have to get system metrics first?

hfheatherfox07


dedndave

WM_SIZE gives some info in wParam

wParam tells you if it's maximized or minimized - you really don't need that
although - no need to do anything if minimized   :P

then, GetWindowRect
subtract the widths to set the positions

hfheatherfox07

Quote from: dedndave on August 31, 2011, 11:06:50 PM


then, GetWindowRect
subtract the widths to set the positions


I am not sure I get that....what widths?

I found this   http://www.suite101.com/content/windows-gui-programming-resize-tip-a54796   is that what you mean?



dedndave

here - try this one.....

qWord

if you want to keep the proportions, you must store the the controls position as factors relative to the client ares size. This calculation can be done at initialization. If the window gets resized, you must recalculate and applie all positions and sizes.
FPU in a trice: SmplMath
It's that simple!

hfheatherfox07

I found another use for "WM_SIZE"

elseif uMsg == WM_SIZE
        invoke SendMessage,hToolBar,TB_AUTOSIZE,0,0
        invoke MoveWindow,hStatus,0,0,0,0,TRUE


from hutch's old page here : http://www.movsd.com/masm.htm

I am going to have to make up Project.inc when I get home tonight ( I have dbmacros.asm, errormac.asm )

hfheatherfox07

Quote from: dedndave on August 31, 2011, 11:41:14 PM
here - try this one.....

thanks   :U....
curious ...how come you use ebx for the handle (hwnd) ?

dedndave

saves a few bytes, is all   :P
we use the handle 5 times
so, it saves ~5 bytes

hfheatherfox07

Quote from: dedndave on August 31, 2011, 11:57:00 PM
saves a few bytes, is all   :P
we use the handle 5 times
so, it saves ~5 bytes

:U

Cool.... I will try that tonight on the round corners  version I have it working but with hWnd
That is something to keep in mind from now on

Thanks again