[comp.os.os2.misc] modeless dialogs

tg2r@dale.acc.Virginia.EDU (Todd Greenwald) (08/09/90)

Another puzzlar from UVa...

Here's some PM mental gymnastics (at least for me!!)

The problem:
	How to relatively draw the controls within a 
	resizable modeless dialog box.

An Example:
	For those with the IBM toolkt12, take a look at
	the dialog2.exe example.  If you change the resource
	file by adding FCF_MINMAX | FCF_SIZEBORDER to the
	DIALOG statement "Modeless Dialog Example" the dialog
	becomes resizeable.

	However, the controls within the modeless dialog keep 
	their x, y, cx, cy relative to the dialog.  The dialog
	acts as a 'shutter' over the controls, instead of the controls
	resizing relative to the dialog.

Proposed solution:
	I'm reasoning that all I need to know is the ratio of
	cx(old) / cx(new) and cy(old) / cy(new) and by
	multiplying the x, y, cx, cy of every control, they
	should all scale up (or down).
	WM_SIZE gives all these values and should feed WM_PAINT
	nicely.

The Problem:
	I can't get the modeless dialog procedure to recogneze
	WM_SIZE. (WM_ADJUSTPOS and WM_PAINT are received.)

The Question:
	Is my logic correct, or am I oversimplifying?
	Is there something special re dialog processing
	   that screens out WM_SIZE (or is there a prerequisite
	   flag to be set either at registration or at DIALOG)?

Thanks !!
Todd Greenwald