Solved

Win32 Tab Control Usage

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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.

776 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