tags:

views:

172

answers:

2

Hello,

I have a basic Win32 dialog-based application. How do I make it resize?

If it was a window this would be possible by default (and it would fire WM_SIZE). I'm new to dialogs and I'm not able to figure out how to: 1. when mouse cursor hovers over the edge, it should change to IDC_SIZEWE or IDC_SIZENS, 2. just resize the dialog, I know how to position dialog's content.

A: 

You don't need to do the work yourself about moving the cursor to the edge, there is just a style you need to set in the .rc file or the dialog editor.

From the dialog editor: Set the border to Resizing to allow resizing of the dialog box.

From editing the .rc file directly: Append | WS_THICKFRAME to the line with STYLE

Brian R. Bondy
I tried: DLG_MAIN DIALOGEX 20, 40, 260, 130 and STYLE WS_THICKFRAME, but it doesn't work...
Lars Kanto
Oh, no! I'm stupid! I edited the wrong .rc file! It works with WS_THICKFRAME!
Lars Kanto
Added border = resizing to get it to work
Brian R. Bondy
A: 

What window styles have you set on your dialog?

If you're using a framework such as MFC, you can repair a dialog that is no longer resizable by making sure the WS_THICKFRAME / WS_SIZEBOX or other suitable window style is set. In some development environments, this may also be set in the properties for the dialog if you are using something with runtime support.

If you created the window manually, specify one or the other in your call to CreateWindow / CreateWindowEx along with your other window styles. Some window styles, such as WS_OVERLAPPED also imply a resizable frame.

Window Styles @ MSDN
CreateWindowEx @ MSDN

meklarian