Solved

MFC Programming question

Posted on 1997-07-28
5
200 Views
Last Modified: 2013-11-20
I'm trying to customize the file open dialog in Windows 95. The basic method of designing a child template and having the controls automatically added to the bottom of the default dialog works fine. However, I want to place these controls to the side of the default controls. So I'm using the stc32 method. However, I'm getting some weird placement behaviour. Is there a way to pull in the default template (like you would if you were making changes to the win 3.1 version of the default dialog) so that I can quickly at my controls and be done with it?

My controls are a list box, a static label, and two buttons. I don't know how this formatting is goning to look but the basic gist is I'd like two buttons beside the Open and Cancel buttons and I'd like the list box to be the height of the window and to the right of the default controls.



         ____________                
Look in |____________|                     Files Selected
 ______________________________              ___________
|                              |            |           |
|                              |            |           |  
|                              |            |           |  |______________________________|            |           |
                                            |           |
File name:    [EF]   [open btn]  [my btn]   |           |
Files of type [EF]   [cncl btn]  [my btn2]  |___________|


I'm using DevStudio vs 5.0 on Windows 95

Thank you
0
Comment
Question by:winkle
  • 3
  • 2
5 Comments
 

Author Comment

by:winkle
ID: 1302869
Edited text of question
0
 

Author Comment

by:winkle
ID: 1302870
Edited text of question
0
 
LVL 8

Accepted Solution

by:
gelbert earned 0 total points
ID: 1302871
What you have to do is to place static control with ID stc32 into your template and place your controls below and on the right side of this control. This is the only way to add controls.
  If you have ID of controls which you want to move/hide you can use get pointer to them CWnd* pWnd = GetParent()->GetDlgItem( ID ).
0
 

Author Comment

by:winkle
ID: 1302872
I've tried about 10 different permutations of the stc32 method. The suggestion of putting all of my controls below and to the right of the static control (stc32) then the top of the list box winds up below and to the right of the controls in the default file open dialog. I understand, now, that this is the only way to do this. Regarding your suggestion to get the pointer to the default controls...How can I find out the IDs for Win 95 controls. I get pointed to dlgs.h and Fileopen.dlg for old style file open dialog, but haven't found anything for the win 95 version.

0
 
LVL 8

Expert Comment

by:gelbert
ID: 1302873
There is template for new "FileOpen" dialog

NEWFILEOPENORD DIALOG DISCARDABLE  0, 0, 280, 164
STYLE DS_MODALFRAME | 4L | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | DS_CONTEXTHELP | WS_CLIPCHILDREN
CAPTION "Open"
FONT 8, "MS Sans Serif"
BEGIN
    LTEXT           "Look &in:",stc4,7,6,41,8,SS_NOTIFY
    COMBOBOX        cmb2,50,3,138,100,CBS_DROPDOWNLIST |
                    CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
                    WS_VSCROLL | WS_TABSTOP
    LTEXT           "",stc1,188,2,82,17,NOT WS_GROUP | NOT WS_VISIBLE
    LISTBOX         lst1,4,20,272,85,LBS_SORT | LBS_NOINTEGRALHEIGHT |
                    LBS_MULTICOLUMN | WS_HSCROLL | NOT WS_VISIBLE
    LTEXT           "File &name:",stc3,5,112,36,8,SS_NOTIFY
    EDITTEXT        edt1,54,110,155,12,ES_AUTOHSCROLL
    LTEXT           "Files of &type:",stc2,5,128,46,8,SS_NOTIFY
    COMBOBOX        cmb1,54,126,155,53,CBS_DROPDOWNLIST |
                    WS_VSCROLL | WS_TABSTOP
    CONTROL         "Open as &read-only",chx1,"Button",BS_AUTOCHECKBOX |
                    WS_TABSTOP,54,145,74,10
    DEFPUSHBUTTON   "&Open",IDOK,222,110,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,222,128,50,14
    PUSHBUTTON      "&Help",pshHelp,222,145,50,14
END
Customization Guidelines
You can customize any of the common dialog boxes. You might, for instance, want to hide some of the original controls, add a few new controls, or enlarge a dialog box. If your application subclasses controls in any of the common dialog boxes, the subclass must be done during the processing of the WM_INITDIALOG message in the application’s hook function. This allows the application to receive the control-specific messages first.
In general, it’s not a good idea to customize the common dialog boxes too severely. After all, one of their chief benefits is a look and feel consistent with the rest of the Windows 95 user interface. I’d suggest that you customize these dialog boxes only if necessary, leaving the original look intact as much as possible. Users won’t be confused by small modifications, however, such as a change in the size of the dialog box or the addition of a new control or two.

 I got it from MSDN - January 97 CD "Learning New IDs"
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Decoding 32 bit binary streams 6 31
Windows Drag & Drop Location 2 85
repeateFront java challenge 31 87
Window placement 17 65
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now