3

I am currently trying to create a CHM help file where a user can enter values which will then generate a button to send the lPARAM to the WM_TCARD.

Currently, I have tested in IE 11, 10, 9 & 8, according to the DOM Explorer the object is being created with the correct parameters but it is not displaying correctly and not appearing as a button.

<body>
<button onclick="create_object();">Try it</button>
<input type="text" id="layout_enter" />
<button id=click_button99 onclick="click_new_object();">click</button>
<script>

function create_object() {

    var new_obj = document.createElement("OBJECT");
    new_obj.setAttribute("classid", "clsid:41B23C28-488E-4E5C-ACE2-BB0BBABE99E8");
    new_obj.setAttribute("codebase", "HHCTRL.ocx#Version=4,72,8252,0");
    new_obj.setAttribute("type", "application/x-oleobject");
    new_obj.setAttribute("id", "object99");
    document.body.appendChild(new_obj);

    var layout_entered = "10," + 
    document.getElementById('layout_enter').value

    var z = document.createElement("PARAM");
    z.setAttribute("name", "Button");
    z.setAttribute("value", "PP Sonic");
    document.getElementById("object99").appendChild(z);

    var y = document.createElement("PARAM");
    y.setAttribute("name", "Command");
    y.setAttribute("value", "TCard");
    document.getElementById("object99").appendChild(y);

    var x = document.createElement("PARAM");
    x.setAttribute("name", "Image");
    x.setAttribute("value", " ");
    document.getElementById("object99").appendChild(x);

    var w = document.createElement("PARAM");
    w.setAttribute("name", "Item1");
    w.setAttribute("value", layout_entered);
    document.getElementById("object99").appendChild(w);

    var v = document.createElement("PARAM");
    v.setAttribute("name", "UseButton");
    v.setAttribute("value", "TRUE");
    document.getElementById("object99").appendChild(v);

    var u = document.createElement("PARAM");
    u.setAttribute("name", "UseIcon");
    u.setAttribute("value", "TRUE");
    document.getElementById("object99").appendChild(u);
}

function click_new_object() {
    document.getElementById("object99").click();
}
</script>
</body>

Any help/advice will be appreciated. I have already looked at the security options in Internet Options for ActiveX which did not resolve anything. If I was to have the object present in the code already then it appears. Making me think it's not an issue with the object but the creation.

Please note: I cannot use JQuery.

Thank you.

1 Answers1

1

As far as I remember this was broken - and buttons too - by security updates.

During 2004-2005 Windows was constantly under attack. In an effort to close the many security holes MS decided to reduce HTML Help's functionality to that of local help only.

It's important to note that while Workshop help documents the following remote features, they don't actually work anymore in Windows XP and later.

  • HTML Help ActiveX Control The main help code library (executable) for the HH Viewer is stored in hhctrl.ocx. So this is a DLL with some ActiveX functionality. Before the security updates you could use this control to embed the TOC and Index into web pages.
  • The HTML Help Java Applet This used Sun Java as an alternative way to embed navigation (TOC/Index) into a web page. It was never maintained by Microsoft and has fallen into an unusable state (even before the crippling security updates). So just ignore this feature.

I tried following shortcut link many years ago. As a replacement of the missing button? - I'm note sure! Please note, this only works in a compressed CHM file.

<html>
<head>
<title>Using CHM shortcut links</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="Shortcut, Link" />
<meta name="MS-HKWD" content="Shortcut" />
<meta name="MS-HKWD" content="Link" />
<link href="../design.css" rel="stylesheet" type="text/css" />

<OBJECT id=MyUniqueID type="application/x-oleobject"
classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
  <PARAM name="Command" value="ShortCut">
  <PARAM name="Item1" value=",http://www.help-info.de/index.htm,">
  <PARAM name="Item2" value=",,">
  <!-- second item parameter seems to be required when downloaded from web with "Open/Save Dialog" -->
</OBJECT>

</head>

<body>

<h1>Using CHM shortcut links</h1>
<p>This is a simple example how to use shortcut links from a CHM file and jump 
  to a URL with the users default browser.</p>
<p>Example:</p>
<p><a href="javascript:MyUniqueID.Click()">Click me to go to www-help-info.de</a></p>

</body>
</html>
help-info.de
  • 6,695
  • 16
  • 39
  • 41