Solved

Win32 Tab Control Usage

Posted on 2004-08-19
3
2,264 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
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 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 learn how to clear a vector as well as how to detect empty vectors in C++.

744 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

11 Experts available now in Live!

Get 1:1 Help Now