Currently viewing: GipsySoft » Front Page» QHTM

How to handle hyperlinks

QHTM will manage internal document links, that is links starting with # and linking directly to a named section within your HTML document.

QHTM is not a browser control and has no networking facilities. QHTM will not automatically navigate to HTML pages stored on web servers or disk.

To help you do this QHTM has a callback mechansim that will notify your application, or the parent window, whenever the user clicks on a link. This makes it easy to use QHTM on a dialog box or as the display engine for a help system.

When your window recieves WM_NOTIFY from a QHTM control you will have the option of letting the control handle the link or your code handling the link. At this point you can set new HTML into the control or ignore the link.

You can navigate to a named anchor (internal link) by using the QHTM_GOTO_LINK API.

Examples


The API example demonstrates these techniques by using the QHTM control as a means of dialog control, giving the user choices within the HTML. The API example also shows how you can prohibit, and therefore manage, linking.

The MFC example shows how you can have links in the main window HTML that will display dialogs just like a menu item or a toolbar would.