Solved

Win32 Tab Control Usage

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
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…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

685 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