Solved

Removing Help button from a modal CPropertySheet

Posted on 1997-04-07
6
668 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
Comment Utility
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
Comment Utility
Hi,
Which version of MFC are you using ?
0
 
LVL 2

Expert Comment

by:rajesh032097
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 1

Expert Comment

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

Author Comment

by:kso
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 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