Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

max/min buttons

Posted on 2000-02-28
10
253 Views
Last Modified: 2010-04-02
in visual C++ 6.0 how do you get max/min buttons by just entering source code.  i can get the boxes if there is a picture of the window.  that simple, just a click away.  but i added a function to a button and i am required to make the window that the function creates have max/min buttons.  help me please!!!!
0
Comment
Question by:klaasvaak
  • 4
  • 3
  • 2
  • +1
10 Comments
 

Author Comment

by:klaasvaak
ID: 2573028
Adjusted points to 125
0
 
LVL 1

Expert Comment

by:BigOne
ID: 2576920
>>but i added a function to a button >>and i am required to make the window >>that the function creates have >>max/min buttons.  

What kind of window are you creating?
0
 
LVL 1

Expert Comment

by:BigOne
ID: 2576938
Not knowing what you are doing, I will make some assumptions and recommend that you speciy the WS_MAXIMIZEBOX and WS_MINIMIZEBOX styles when you create the window.  Have you tried this yet?

0
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.

 

Author Comment

by:klaasvaak
ID: 2580135
I created an MFC AppWizard (exe).  The program is a dialogue box with two buttons.  You can also click on the icon in the corner to bring up a window that shows version information.  I was supposed to edit that window to have an extra button.  The dialogue window that comes up when you click on that button needs to have the max/min buttons on it.  
0
 
LVL 1

Expert Comment

by:BigOne
ID: 2580344
It sounds like you have a dialog based app with version information(the CAboutDlg, Probably IDD_ABOUTBOX in your resources) You can add a button to this and launch whatever you want by handling the click.  In your new window you just need to set the styles "WS_MAXIMIZEBOX || WS_MINIMIZEBOX" and that should do it.  I can't help but wonder why you would want to do this.  I would recommend changing your design to use MDI, but it's your code and you kow your needs.

Good Skills
0
 

Expert Comment

by:sinclairj
ID: 2590636
Sounds like you need to do explicit window creation so you can specify the  styles you want.
0
 

Author Comment

by:klaasvaak
ID: 2591979
the thing is i can't get the function i add to the button to create a visual dialogue box.  if i had one of those i could easily go to the styles tab.  but whenever i give the new box text it goes back to source code and no new box appears
0
 

Expert Comment

by:sinclairj
ID: 2595561
The "DLGTEMPLATE DialogTemplate;" must be declared globably or as a member variable.  I know the glabal declaration works.

DialogTemplate.style=(WS_SYSMENU|WS_MAXIMIZEBOX|WS_MINIMIZEBOX|DS_MODALFRAME);
      DialogTemplate.cdit=0;
      DialogTemplate.x=0;
      DialogTemplate.y=0;
      DialogTemplate.cx=250;
      DialogTemplate.cy=50;

      CDialog dlg;
      bool ret=dlg.InitModalIndirect(&DialogTemplate);
      dlg.DoModal();

YOu must have the sysmenu style specified or the max/min boxes don't work.


I just copied this code from test program.
0
 

Author Comment

by:klaasvaak
ID: 2636040
i don't understand!!!
i'm a serious newbie and don't understand your high tech mumbo jumbo!!
can you dumb it down some, PLEASE
0
 
LVL 1

Accepted Solution

by:
Dhrubajyoti earned 125 total points
ID: 2711045
Edit  property of the  dialog in which  you want the  maximize mimize button.
you can edit in two ways

1. go to workspace of VC++ 6.
2. you will find class view resource view and file view .
3.select resource.
4.select dialog id in which u want the button
5.rigth click & get the propery page
6.select the style tab
7.select the maximize and minimize option

or edit the .rc file
add the following line for the dialog box
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP |
    WS_CAPTION | WS_SYSMENU    
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

791 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