From: Larry on
How to make a Dialog resizable

Hi,

I am dealing with dialog window created usign ResEdit as a resource
editor. Now, I'd need to make a window resizable and to have all the child
controls in it resize themselves according to the dialog size. Can iy
actually be done?


This is the code for the dialog:

[code]
//
// Dialog resources
//

IDD_POPUP DIALOG 25, 25, 485, 254
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
WS_SYSMENU
CAPTION "List View Window"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", IDC_LIST1, WC_LISTVIEW, WS_TABSTOP | WS_BORDER |
LVS_ALIGNLEFT | LVS_REPORT, 4294967294, 4294967295, 489, 230
END
[/code]

thanks

From: Larry on

"Larry" <dontmewithme(a)got.it> ha scritto nel messaggio
news:4b79f55e$0$1104$4fafbaef(a)reader4.news.tin.it...

> I am dealing with dialog window created usign ResEdit as a resource
> editor. Now, I'd need to make a window resizable and to have all the child
> controls in it resize themselves according to the dialog size. Can iy
> actually be done?

I see lots of examples of how to do this out there but they are all for MFC
or other toolkits. I need to do this in a C++ app using normal win32 API
calls.

From: Christian ASTOR on
On 16 fév, 02:31, "Larry" <dontmewit...(a)got.it> wrote:

>   I am dealing with dialog window created usign ResEdit as a resource
> editor. Now, I'd need to make a window resizable and to have all the child
> controls in it resize themselves according to the dialog size. Can iy
> actually be done?

See the old MS sample SclblDlg.exe
From: Larry on

"Christian ASTOR" <castorix(a)club-internet.fr> ha scritto nel messaggio
news:7ed00f97-7db7-41c6-bd2f-212803d690f1(a)g28g2000yqh.googlegroups.com...
On 16 f�v, 02:31, "Larry" <dontmewit...(a)got.it> wrote:

> I'd need to make a window resizable and to have all the child
> controls in it resize themselves according to the dialog size. Can iy
> actually be done?

I guess the following code is step into the right direction:

{
int dlgw = 0;
int dlgh = 0;
TCHAR szWidth[5] = {0};
TCHAR szHeight[5] = {0};
TCHAR marameo[256] = {0};
HWND hListView = GetDlgItem(hDlg, IDC_LIST1);

case WM_SIZE:
//
// WM_SIZE Notification
// http://msdn.microsoft.com/en-us/library/ms632646%28VS.85%29.aspx
//

// Resize List view inside window
//
dlgw = (int)LOWORD(lParam);
dlgh = (int)HIWORD(lParam);

_itot_s(dlgw,szWidth,5,10);
_itot_s(dlgh,szHeight,5,10);

_tcsncat_s(marameo, _T("Width: "),10);
_tcsncat_s(marameo, szWidth,5);
_tcsncat_s(marameo, _T(" Height: "),10);
_tcsncat_s(marameo, szHeight,5);

SetWindowText(hDlg, (LPTSTR)marameo);

MoveWindow(hListView, -1, -1, (dlgw + 2), (dlgh -25) , true);
ShowWindow(hListView, SW_SHOW);
/////////////////////////////////////////////////////////////////////
}

Now, I'd like ro prevente the dialog from being resized less then a minwidth
and minheight values. do you think it's possible?

From: ScottMcP [MVP] on
On Feb 16, 11:46 am, "Larry" <dontmewit...(a)got.it> wrote:
>
> Now, I'd like ro prevente the dialog from being resized less then a minwidth
> and minheight values. do you think it's possible?

Handle the WM_GETMINMAXINFO message to change the min/max allowed
size.