11.04.2014 Views

Advanced MFC Programming

Advanced MFC Programming

Advanced MFC Programming

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 16. Context Sensitive Help<br />

should be input into the edit box labeled “Title”, and the footnote tag should be input into the edit box<br />

labeled “Topic ID” (Figure 16-7).<br />

Heading<br />

Tab Entries<br />

Figure 16-7. Edit a tab entry<br />

After making any change to the help project, we need to recompile the project in order to get the up-todate<br />

help.<br />

To make the help working, both “.hlp” and “.cnt” file must be copied to the directory that contains the<br />

application executable file.<br />

16.2 Context Sensitive Help for Common Controls<br />

Sample 16.2-1\Help and 16.2-2\Help are based on sample 16.1\Help, they demonstrate how to support<br />

context sensitive help in a dialog box.<br />

Supporting Context Sensitive Help in Dialog Box<br />

The previous section describes how to add context sensitive help for commands. We can also add this<br />

fancy feature for common controls contained in a dialog box. To implement context sensitive help for a<br />

dialog box, we can check “Context Help” check box under “More Styles” page of the “Dialog Properties”<br />

property sheet (Figure 16-8). After this type of dialog boxes are invoked, a question mark button will<br />

appear on their caption bars (Figure 16-9). This button has the same functionality with command<br />

ID_CONTEXT_HELP described in the previous section. By clicking on this button, we will enter help mode,<br />

with the mouse cursor becoming a question mark. As we click any controls contained in the dialog box<br />

with this cursor, the help will be activated and the corresponding help window will be brought up.<br />

Figure 16-8. Enable context sensitive help for dialog box<br />

486

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!