To add to what Peter has already provided, I believe these
options are coded within the application. For example, with a topic
on in the WYSIWYG the second option is "help on WYSIWYG". This
requires a call to the required help topic. Quite how this is done
depends on the output type and the method employed. Peter's site
has a lot of information on this if the option is webhelp.
Quite how the application knows which help menu item to
display I'm not sure. The menu item only seems to change for each
of the screen elements/tabs so must be some sort of code behind the
scenes for each that refers to the required topic.