Using Robohelp if it matters. How can i get the path at runtime of my help file in HtmlHelp? I have a .chm that is merged (but not by me, by the main application). How can i get the slave .chm to open in its own window when its entry in the TOC is clicked?
This worked using a "hidden" file with some javascript, but doesn't work after the merge:
<a href="Hidden.htm">Click For SlaveB.chm through hidden</a>
This is in the "hidden" htm file:
<object
classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"
id="window_opener" type="application/x-oleobject">
<param name="Command" value="Shortcut" />
<param name="Font" value="Microsoft Sans Serif,8,0,," />
<param name="Item1" value=",hh.exe,./SlaveB.chm::/MyTopic.htm"/>
</object>
<!--Metadata type="DesignerControl" endspan-->
<script type="text/javascript">window_opener.hhclick();
history.back();</script>
This worked but doesn't open my .chm in a new window:
<p><a href="SlaveB.chm::/MyTopic.htm">Click For MyTopic.htm in same window</a></p>
It also worked if i use a hard coded absolute path to the .chm with a topic. I simply want to find the path the current .chm is working from and open a.chm (which is in the same directory) in a new window. This can be a simple .chm that is merged that only provides the link/open of the other .chm (the one i want to open in a new window). For example, SlaveA.chm IS merged into the main app's Master .chm (i don't have access to edit this one), but SlaveA simply exists for a TOC entry in Master that links/opens my SlaveB.chm in a completely new window (slave B is not merged at all)
I ended up using the following javascript to get the location, remove the end and place my slave .chm file on the end, then open it in a new window:
<button onclick="showExternalHelp()">Show Help</button>
<script type="text/javascript">function showExternalHelp()
{
var location = window.location.pathname;
var splitter = "\\";
var lastIndex = location.lastIndexOf(splitter);
location = location.substring(0, lastIndex);
location = location + "\\External.chm";
window.showHelp(location);
}</script>