Microsoft KB Archive/112639

{|
 * width="100%"|

SclblDlg.exe Demonstrates Scaleable Controls in Dialog

 * }

Q112639

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK)
 * Microsoft Windows Software Development Kit (SDK) 3.1

-

SUMMARY
In certain circumstances it is desirable to dynamically scale the controls in a dialog box to the size of the dialog box window. Sclbldgl.exe is a file in the Microsoft Software Library that contains sample code implementing scaleable controls in a dialog box.

MORE INFORMATION
The following file is available for download from the Microsoft Download Center:

"SclblDlg.exe" For additional information about how to download Microsoft Support files, click the article number below to view the article in the Microsoft Knowledge Base:

"Q119591 How to Obtain Microsoft Support Files from Online Services" Microsoft used the most current virus detection software available on the date of posting to scan this file for viruses. Once posted, the file is housed on secure servers that prevent any unauthorized changes to the file.

To accomplish scaleable controls in a dialog box, the following messages are processed:

  WM_INITDIALOG - To store original dimensions of the dialog box and all its controls, together with the font the dialog box uses. The original dimensions are stored using SetProp in this sample. The font handle is  stored in a static variable to be used with in WM_SIZE.

WM_SIZE - To calculate the scaling factor, and then scale up or down the font and all the controls in the dialog box.

WM_GETMINMAXINFO - To set the minimum size of the dialog box so the controls are not truncated.

WM_COMMAND - To clean up when closing the dialog box. RemoveProp is  called to remove the stored dimensions from the property list of the dialog box window and all its child control windows. NOTE: Special processing is required for calculating the dimensions of CBS_DROPDOWN and CBS_DROPDOWNLIST style combo boxes. GetWindowRect returns the dimensions of the edit portion of the combo box, excluding the drop-down list. To get the correct height for such combo boxes, the value returned by CB_GETDROPPEDCONTROLRECT is used instead of GetWindowRect.

Additional query words: proportional sizing

Keywords : kbfile kbsample kbCtrl kbDlg kbOSWinNT kbOSWinNT350 kbOSWinNT351 kbOSWin2000 kbSDKWin32 kbGrpDSUser kbOSWin kbOSWin95

Issue type : kbinfo

Technology : kbWin32SDKSearch kbAudDeveloper kbWin3xSearch kbSDKSearch kbWin32sSearch kbWinSDKSearch kbWinSDK310