Solved

Removing Help button from a modal CPropertySheet

Posted on 1997-04-07
6
678 Views
Last Modified: 2013-11-20
How can I remove/hide the Help button on an MFC modal CPropertySheet ?
0
Comment
Question by:kso
6 Comments
 
LVL 2

Expert Comment

by:rajesh032097
ID: 1300916
Hi,
CPropertySheet class has PROPSHEETHEADER structure member, m_psh, which has dwflag member. You can change the PSH_HASHELP flag of this structure to show / hide the help button.
Hope this works.

0
 

Author Comment

by:kso
ID: 1300918
Hi,
Which version of MFC are you using ?
0
 
LVL 2

Expert Comment

by:rajesh032097
ID: 1300919
You should not only exclude PSH_HASHELP flag, but also PSP_HASHELP:

PropSheet.m_psh.dwFlags &= ~PSH_HASHELP;
PropPage.m_psp.dwFlags &= ~PSP_HASHELP;
PropSheet.AddPage(&PropPage);
PropSheet.DoModal();

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Expert Comment

by:serge010697
ID: 1300920
Excluding also PSP_HASHELP does not help.
My MFC version is 4.1
0
 

Author Comment

by:kso
ID: 1300921
All tried and no luck. Well are you familiar with the Spy++ tool. You can use a similar technique in your code. Inside the property page use the following technique :

{
//GetParent() get the handle of the CPropertySheet.
//Iterate through the child windows inside CpropertySheet and
//find the window with the ID IDHELP. This can be done using
//GetWindow() or EnumChildWindows() avoid FindWindow()
//Once you have the handle for the button , use ShowWindow() //or EnableWindow().

}
0
 
LVL 4

Accepted Solution

by:
mbhakta earned 100 total points
ID: 1300922
The easiest way to do it is to override OnInitDialog() of a propertypage of the sheet and add the following:

GetParent()->GetDlgItem(IDHELP)->ShowWindow(SW_HIDE);
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

895 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

15 Experts available now in Live!

Get 1:1 Help Now