Removing Help button from a modal CPropertySheet

How can I remove/hide the Help button on an MFC modal CPropertySheet ?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.

ksoAuthor Commented:
Which version of MFC are you using ?
You should not only exclude PSH_HASHELP flag, but also PSP_HASHELP:

PropSheet.m_psh.dwFlags &= ~PSH_HASHELP;
PropPage.m_psp.dwFlags &= ~PSP_HASHELP;

Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Excluding also PSP_HASHELP does not help.
My MFC version is 4.1
ksoAuthor Commented:
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().

The easiest way to do it is to override OnInitDialog() of a propertypage of the sheet and add the following:


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.