max/min buttons

Posted on 2000-02-28
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!!!!
Question by:klaasvaak
  • 4
  • 3
  • 2
  • +1

Author Comment

ID: 2573028
Adjusted points to 125

Expert Comment

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?

Expert Comment

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?


Author Comment

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.  

Expert Comment

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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.


Expert Comment

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

Author Comment

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

Expert Comment

ID: 2595561
The "DLGTEMPLATE DialogTemplate;" must be declared globably or as a member variable.  I know the glabal declaration works.|WS_MAXIMIZEBOX|WS_MINIMIZEBOX|DS_MODALFRAME);

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

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

I just copied this code from test program.

Author Comment

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

Accepted Solution

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 . resource. dialog id in which u want the button
5.rigth click & get the propery page the style tab the maximize and minimize option

or edit the .rc file
add the following line for the dialog box

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

708 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

15 Experts available now in Live!

Get 1:1 Help Now