Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Explorer-style custom templates

anthonyrichards
New Contributor III
735 Views
I have used a previous thread as a guide to add a custom template and hook procedure to the OPENFILENAME structure of the GETOPENFILENAME function to successfully add controls below those in the default-style dialog box. However, I find one behavior at variance to the documentation, which states (reproduced below) that the system expands the default dialog by the width and height of the custom dialog. I find that the width will not change if I make my custom dialog wider than the default dialog. Any ideas why? My custom dialog has the styles mentioned below (given by clicking the right boxes on the Styles property sheets in resource editor)

From the Help:

You can create your child dialog box template as you do any other template, except that you must specify the WS_CHILD and WS_CLIPSIBLINGS styles and should specify the DS_3DLOOK and DS_CONTROL styles. The system requires the WS_CHILD style because your template defines a child dialog of the default Open or Save As dialog box. The WS_CLIPSIBLINGS style ensures that the child dialog box does not paint over any of the controls in the default dialog box. The DS_3DLOOK style makes sure that the appearance of the controls in the child dialog box is consistent with the controls in the default dialog box. The DS_CONTROL style makes sure that the user can use the tab and other navigation keys to move between all controls, default or custom, in the customized dialog box.

To make room for the new controls, the system expands the default dialog box by the width and height of the custom dialog box. By default, all controls from the custom dialog box are positioned below the controls in the default dialog box.

0 Kudos
4 Replies
Jugoslav_Dujic
Valued Contributor II
735 Views
I reproduced it as well. Possibly a documentation error, but I didn't find it in the MS knowledge base. (And it's not so easy to find in newsgroups because it's tricky to find right keywords).
In any case, I played a little withstc32 static control mentioned in the cited article .and it seems to provide a workaround (although one can achieve quite funny effects with it as well :-) ). Basically, stc32 = 1119 placed on your custom template determines where the default set of controls will be placed relative to the rest of your dialog. I've attached two pictures of a custom template of mine and the resulting dialog, with stc32 having sunken border for clarity. (Tip: you can specify control ID in the resource editor by typing "IDC_WHATEVER=1119" in "ID" field of control's properties).
Jugoslav
0 Kudos
anthonyrichards
New Contributor III
735 Views

Interesting. Is that a resizable arrow in the bottom right corner? How did you manage that? In my experience, the getopenfilename dialog is not resizable.

0 Kudos
Jugoslav_Dujic
Valued Contributor II
735 Views
integer, parameter:: OFN_ENABLESIZING = $00800000
OFN_ENABLESIZING
Windows2000, Windows 98: Enables the Explorer-style dialog box to be resized using either the mouse or the keyboard. By default, the Explorer-style Open and Save As dialog boxes allow the dialog box to be resized regardless of whether this flag is set. This flag is necessary only if you provide a hook procedure or custom template. The old-style dialog box does not permit resizing.
0 Kudos
Reply