Creating a link from a secondary window to the main window in HTML Help
by Rick Stone
This article is a companion piece to eHelp's Knowledge Base Article 21847 (How to create a link to a secondary window in HTML Help) and helpstuff's Secondary Windows in HTML Help and WinHelp.
Rick recently had a need to do this and was sort of "stuck," as there wasn't an immediately apparent way. He tried to utilize the "Related Topics" trick that was used to get the secondary window open to begin with. However, it failed to behave as he expected when implemented. Basically, he got the topic to display in the main window, but the secondary window he linked from remained in view. He needed a way to force it to close.
Here are the steps he followed to make it happen.
- Inside the topic that will display in the secondary window, follow the steps the articles listed above to use a hidden Related Topics control to establish a link to the desired topic in the main window. Instead of specifying the secondary window name, insert the name of the main window. (You have to modify the TrueCode to insert the Window Name in the first object parameter and the entire parameter including the Window Name in the second object parameters).
- Again, inside the topic that will display in the secondary window, insert a hidden HTML Help Close Window control.
- Here is where the magic happens. Create a hyperlink that will invoke BOTH the Related Topics control AND the Close Window control. The hyperlink properties should be inserted as follows:
JavaScript:CloseWindow.Click();RelatedTopics.Click()
NOTE: You must type CloseWindow.Click() before RelatedTopics.Click(). If you reverse these steps, the entire Help system closes instead of closing only the secondary window.