Custom AppWizard and wizard buttons 
Author Message
 Custom AppWizard and wizard buttons

Hi,

I'm building a custom AppWizard application that uses some of the existing
steps, and several custom steps. Under various circumstances, I would like
to disable the Next, Help, and Finish buttons when my custom dialogs are
displayed. I can't seem to find any help on this in the KB or within V++
MSDN help.

Thx.

Greg



Sat, 25 Oct 2003 07:29:13 GMT  
 Custom AppWizard and wizard buttons

CWnd *ptrNextWnd = GetDlgItem(ID_WIZNEXT);
        ptrNextWnd->EnableWindow(false);

ID_WIZBACK
ID_WIZFINISH

etc.

for more info look at:
Q143210
\...My VC install dir... \MFC\SRC\DlgProp.cpp

Radek

Quote:
> Hi,

> I'm building a custom AppWizard application that uses some of the existing
> steps, and several custom steps. Under various circumstances, I would like
> to disable the Next, Help, and Finish buttons when my custom dialogs are
> displayed. I can't seem to find any help on this in the KB or within V++
> MSDN help.

> Thx.

> Greg



Sat, 25 Oct 2003 09:23:35 GMT  
 Custom AppWizard and wizard buttons
Thx for the help. Unfortunately it doesn't seem to work. The call to
GetDlgItem always returns NULL. I've placed the following code in the
OnInitDialog call of my custom dialog window that goes thru the parent list
to try and find the NEXT button, but NULL is always returned. It loops
through 3 times before exiting.

 CAppWizStepDlg::OnInitDialog();

 CWnd* pWnd = this;
 CWnd* pButton = NULL;

 while (pWnd != NULL)
 {
  pButton = pWnd->GetDlgItem(ID_WIZNEXT);
  if (pButton != NULL)
  {
   pButton->ShowWindow (SW_HIDE);
   break;
  }
  pWnd = pWnd->GetParent();
 }

I believe the problem may be that I don't have a handle to the actual
AppWizard PropertySheet, just to the dialog that is currently displayed on
the sheet. Is there any way to get a handle to this (it doesn't seem to be
the parent or owner of the custm dialog).

Thx again.

Greg


Quote:

> CWnd *ptrNextWnd = GetDlgItem(ID_WIZNEXT);
> ptrNextWnd->EnableWindow(false);

> ID_WIZBACK
> ID_WIZFINISH

> etc.

> for more info look at:
> Q143210
> \...My VC install dir... \MFC\SRC\DlgProp.cpp

> Radek

> > Hi,

> > I'm building a custom AppWizard application that uses some of the
existing
> > steps, and several custom steps. Under various circumstances, I would
like
> > to disable the Next, Help, and Finish buttons when my custom dialogs are
> > displayed. I can't seem to find any help on this in the KB or within V++
> > MSDN help.

> > Thx.

> > Greg



Sat, 25 Oct 2003 23:49:51 GMT  
 Custom AppWizard and wizard buttons
Hi Greg,

I checked this solution with this code

BOOL CMyPropertySheet::OnInitDialog()
{
 BOOL bResult = CPropertySheet::OnInitDialog();

 CWnd *pButton = GetDlgItem(ID_WIZNEXT);

 if (pButton)
  pButton->ShowWindow(SW_HIDE);
 return bResult;

Quote:
}

And with success. Next button was hide.

About test app
1. Simple SDI
2. Project->Add to Project->Components and controls->Visual C
components->Property Sheet
    (in MainFrame, Wizard mode)
3. Code in OnInitDialog() (CMyPropertySheet) above.

I can send you this app in the case of any problems.

Radek

Quote:
> Thx for the help. Unfortunately it doesn't seem to work. The call to
> GetDlgItem always returns NULL. I've placed the following code in the
> OnInitDialog call of my custom dialog window that goes thru the parent
list
> to try and find the NEXT button, but NULL is always returned. It loops
> through 3 times before exiting.

>  CAppWizStepDlg::OnInitDialog();

>  CWnd* pWnd = this;
>  CWnd* pButton = NULL;

>  while (pWnd != NULL)
>  {
>   pButton = pWnd->GetDlgItem(ID_WIZNEXT);
>   if (pButton != NULL)
>   {
>    pButton->ShowWindow (SW_HIDE);
>    break;
>   }
>   pWnd = pWnd->GetParent();
>  }

> I believe the problem may be that I don't have a handle to the actual
> AppWizard PropertySheet, just to the dialog that is currently displayed on
> the sheet. Is there any way to get a handle to this (it doesn't seem to be
> the parent or owner of the custm dialog).

> Thx again.

> Greg



> > CWnd *ptrNextWnd = GetDlgItem(ID_WIZNEXT);
> > ptrNextWnd->EnableWindow(false);

> > ID_WIZBACK
> > ID_WIZFINISH

> > etc.

> > for more info look at:
> > Q143210
> > \...My VC install dir... \MFC\SRC\DlgProp.cpp

> > Radek

> > > Hi,

> > > I'm building a custom AppWizard application that uses some of the
> existing
> > > steps, and several custom steps. Under various circumstances, I would
> like
> > > to disable the Next, Help, and Finish buttons when my custom dialogs
are
> > > displayed. I can't seem to find any help on this in the KB or within
V++
> > > MSDN help.

> > > Thx.

> > > Greg



Sun, 26 Oct 2003 05:39:39 GMT  
 Custom AppWizard and wizard buttons
Radek.

Thanks again for your help!

I can also get your solution working when I want to create my own property
sheet in an applicaiton as you've described here.

The problem I am having is within a Custom AppWizard. I don't have a handle
to the PropertySheet that is being used to display each of the pages in the
wizard. I only have the handle for the custom form that is placed on the
property sheet, and this form is a CDialog desendant.

Without the property sheet handle, I don't have access to the buttons, and
therefore can't manipulate their properties. It doesn't appear that the
AppWizard class itself exposes this handle.

Greg


Quote:
> Hi Greg,

> I checked this solution with this code

> BOOL CMyPropertySheet::OnInitDialog()
> {
>  BOOL bResult = CPropertySheet::OnInitDialog();

>  CWnd *pButton = GetDlgItem(ID_WIZNEXT);

>  if (pButton)
>   pButton->ShowWindow(SW_HIDE);
>  return bResult;
> }

> And with success. Next button was hide.

> About test app
> 1. Simple SDI
> 2. Project->Add to Project->Components and controls->Visual C
> components->Property Sheet
>     (in MainFrame, Wizard mode)
> 3. Code in OnInitDialog() (CMyPropertySheet) above.

> I can send you this app in the case of any problems.

> Radek

> > Thx for the help. Unfortunately it doesn't seem to work. The call to
> > GetDlgItem always returns NULL. I've placed the following code in the
> > OnInitDialog call of my custom dialog window that goes thru the parent
> list
> > to try and find the NEXT button, but NULL is always returned. It loops
> > through 3 times before exiting.

> >  CAppWizStepDlg::OnInitDialog();

> >  CWnd* pWnd = this;
> >  CWnd* pButton = NULL;

> >  while (pWnd != NULL)
> >  {
> >   pButton = pWnd->GetDlgItem(ID_WIZNEXT);
> >   if (pButton != NULL)
> >   {
> >    pButton->ShowWindow (SW_HIDE);
> >    break;
> >   }
> >   pWnd = pWnd->GetParent();
> >  }

> > I believe the problem may be that I don't have a handle to the actual
> > AppWizard PropertySheet, just to the dialog that is currently displayed
on
> > the sheet. Is there any way to get a handle to this (it doesn't seem to
be
> > the parent or owner of the custm dialog).

> > Thx again.

> > Greg



> > > CWnd *ptrNextWnd = GetDlgItem(ID_WIZNEXT);
> > > ptrNextWnd->EnableWindow(false);

> > > ID_WIZBACK
> > > ID_WIZFINISH

> > > etc.

> > > for more info look at:
> > > Q143210
> > > \...My VC install dir... \MFC\SRC\DlgProp.cpp

> > > Radek

> > > > Hi,

> > > > I'm building a custom AppWizard application that uses some of the
> > existing
> > > > steps, and several custom steps. Under various circumstances, I
would
> > like
> > > > to disable the Next, Help, and Finish buttons when my custom dialogs
> are
> > > > displayed. I can't seem to find any help on this in the KB or within
> V++
> > > > MSDN help.

> > > > Thx.

> > > > Greg



Sun, 26 Oct 2003 05:51:59 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. About AppWizard and developing custom wizards

2. Manual registration of class wizard in Custom AppWizard

3. disabling the FINISH button in the main window of a custom wizard

4. Problem with custom template files in VC5 custom AppWizards

5. Problem with custom template files in VC5 custom AppWizards

6. Custom Appwizard how to custom Lib and Include?

7. Custom Build Steps in a Custom AppWizard

8. How to make Cancel button not default button on Wizard Page

9. Owner draw button in replacement of the next/back button in a CPropertySheet in Wizard mode

10. WEIRD: Code works in MFC AppWizard (exe) but not OLE Control Wizard (ocx)

11. Using the MFC ActiveX Control Wizard instead of the MFC AppWizard (exe)

12. custom appwizard

 

 
Powered by phpBB® Forum Software