Solved

Win32 Tab Control Usage

Posted on 2004-08-19
3
2,274 Views
Last Modified: 2012-06-21
I am able to create a tab control in Visual C++ 6.0 on my Win32 Application, but how do i get it to display a different group of controls for each tab?  Right now i can only get it to click across tabs, how do i get it to show different controls after clicking a different tab?  I've heard you have to use a different dialog for each tab???  A link or working sample code would help in explaining how to do this to me.  I have searched the web and could only find MFC based examples.  A quick response would be great because it will be about two weeks before i am able to do a response.  I am increasing the points.  Thanks in advance!
0
Comment
Question by:MatrixFreak
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
hsdhina earned 400 total points
ID: 11880241
Hi,
  Following is the sample code for using Tab Dialog using WIN32 application.

Thanks
hsdhina

        PROPSHEETPAGE   gPSP[2];
        PROPSHEETHEADER gPSH;
        int idx = 0;

        gPSP[idx].dwSize                      = sizeof(PROPSHEETPAGE);
        gPSP[idx].dwFlags                     = 0;
        gPSP[idx].hInstance                   = ghInstance;
        gPSP[idx].DUMMYUNIONNAME.pszTemplate  = MAKEINTRESOURCE(IDD_SPLASH);
        gPSP[idx].DUMMYUNIONNAME2.pszIcon     = NULL;
        gPSP[idx].pfnDlgProc                  = (DLGPROC)SplashDialogProc;
        gPSP[idx].pszTitle                    = NULL;
        gPSP[idx].lParam                      = 0;
        gPSP[idx].pfnCallback                 = NULL;
        idx++;

        gPSP[idx].dwSize                      = sizeof(PROPSHEETPAGE);
        gPSP[idx].dwFlags                     = 0;
        gPSP[idx].hInstance                   = ghInstance;
        gPSP[idx].DUMMYUNIONNAME.pszTemplate  = MAKEINTRESOURCE(IDD_WELCOME);
        gPSP[idx].DUMMYUNIONNAME2.pszIcon     = NULL;
        gPSP[idx].pfnDlgProc                  = (DLGPROC)WelcomeDialogProc;
        gPSP[idx].pszTitle                    = NULL;
        gPSP[idx].lParam                      = 0;
        gPSP[idx].pfnCallback                 = NULL;
        idx++;


        gPSH.dwSize                     = sizeof(PROPSHEETHEADER);
        gPSH.dwFlags                    = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_WIZARD;
        gPSH.hwndParent                 = ghMainWindowHandle;
        gPSH.hInstance                  = ghInstance;
        gPSH.DUMMYUNIONNAME.pszIcon     = "SetupIcon";
        gPSH.pszCaption                 = "Inteli-Installer";
        gPSH.nPages                     = idx;
        gPSH.DUMMYUNIONNAME2.nStartPage = 0;
        gPSH.DUMMYUNIONNAME3.ppsp       = (LPCPROPSHEETPAGE)&gPSP;
        gPSH.pfnCallback                = NULL;


where IDD_SPLASH & IDD_WELCOME are different dialog resources.
          SplashDialogProc & WelcomeDialogProc are callback functions
0
 
LVL 1

Author Comment

by:MatrixFreak
ID: 11938988
Well, i'm back and i haven't gotten a chance to try out your code yet but i will give a response by tomorrow or should i say today?  The code looks right so more than likely you will get the points.
0
 
LVL 1

Author Comment

by:MatrixFreak
ID: 11950333
It works great! Thank you for the help hsdhina.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

Title # Comments Views Activity
C++ Language error 28 245
How to gracefully close the c++ 11 thread? 3 107
Why isn't object file created? 6 68
VS2015 Redefinition errors 4 68
Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
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…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

808 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