Context help button behaviour on CPropertySheet

2019-07-14 05:13发布

问题:

The latest version of Microsoft Office uses property sheets that have the context help [?] button next to the close button:

When the context button is clicked it invokes the application's help rather than switching to 'context mode', by which I mean the arrow cursor with a question mark, i.e. there is no context help despite this being the context help button (or appears to be).

I'm trying to recreate this behaviour in an property sheet derived from the MFC CPropertySheet. So far I've had no luck. Ideally I'd like a click on this button to act in the same way as pressing F1, e.g. call directly on to the OnHelpInfo function.

Can anyone tell me how this might be achieved?

回答1:

As per my comment, adding ON_WM_SYSCOMMAND to the message map and then processing SC_CONTEXTHELP in OnSysCommand did the trick.



标签: mfc