Solved

MFC Programming question

Posted on 1997-07-28
5
207 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
repeatEnd java challenge 42 85
Perl Awk Need Help 3 128
Authenticate using sesu from script 7 57
How do I get Window Title of all opened process? 4 14
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

839 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