Hi, how i can resize my dlg ?

Greets Red Forginforcer
Posted on 2003-03-18 11:58:08 by Forginforcer

Hi, how i can resize my dlg ?

Greets Red Forginforcer


Dont you do any research on a topic you ask here yourself?
Posted on 2003-03-18 13:05:53 by bazik
Red,

Here is a tip, get the window handle of the dialog, (first parameter passed to dialog proc) and use the API "MoveWindow" to change its size.

You can also use the API SetWindowPos but its a bit harder to use.

Regards,

hutch@movsd.com
Posted on 2003-03-19 02:33:57 by hutch--
thanks for your help. I didn't know thats this function also do that.
But, I also replace the Dlg.

INVOKE GetWindowRect, hDlg, ADDR tempRec
INVOKE SetWindowRgn, hDlg,tempRec, 1

Thats my current code.
How I can give tempRec new values ?

Greets Red Forginforcer
Posted on 2003-03-19 07:26:37 by Forginforcer
mov DWORD PTR, 200 ;left
mov DWORD PTR, 200 ;top
mov DWORD PTR, 200 ;right
mov DWORD PTR, 200 ;bottom

btw you should be using the api MoveWindow and not SetWindowRgn.
Posted on 2003-03-19 07:45:29 by roticv
Red,

I made you the suggestion with the two functions for a reason, they are the two that CAN change a window size, the one you are trying to use is wrong.

With this code,

INVOKE GetWindowRect, hDlg, ADDR tempRec
INVOKE SetWindowRgn, hDlg,tempRec, 1

The second "invoke" has an error, you should use ADDR with tempRec on both lines.

The suggestion by roticv is fine but you can address a LOCAL rect structure directly with code like,


mov rct.left, 100
mov rct.top, 150
mov rct.right, 75
mov rct.bottom, 125


Regards,

hutch@movsd.com
Posted on 2003-03-20 03:13:00 by hutch--