I did see a similar post from 2013 but it was for a web app and used the session.HashTag Changed event but that does not seem to be applicable to a desktop app.
I am considering using the MouseDown event in the HTMLViewer and correlating the coordinates with the links so the proper window can be displayed. My worry here is that users may have different sized fonts and the mouse coordinates won’t match the stored values for the links. Perhaps I would have more control if I used a TextArea to display the RTF data. Another alternative would be to create PDF pages where I would have complete control of the font and font size.
Any suggestions on this will be greatly appreciated. I can envision spending a lot of time creating a system, then finding it only works part of the time.
In the html, you create special links using a domain that you can easily identify and extract data from. Let’s say you use something like this:
Then in the CancelLoad event, the first thing you check is if url.left(16) = “http://internal/”. If it is, you strip that part off and you have an indicator of which window to open.
The easiest path from here is to have a method that contains a select-case statement which converts from a string to each of the windows you want to access. Make sure you add a Case Else statement for testing which just contains a break statement so you can catch strings that you haven’t handled yet.
HelpNDoc has a system for this.
I use it to compile both a PDF and an HTML based help file.
Each subject in the HTML not only has a page, but also maps to a numbered link.
I have a global variable that holds information about ‘the thing you are looking at’ - eg in the activation of a window or tab, the variable is set to ‘the right value’
If help is requested, I call up the appropriate web page using that global variable.
It’s similar to the way that Windows help systems worked (and it can in fact also generate a CHM help file), but this method allows for Mac or WIndows builds to use the same help