2017-09-28 10 views
3

현재 사용자가 값을 입력 할 수있는 CHM 도움말 파일을 만들려고합니다. 그러면 lPARAM을 WM_TCARD로 보내는 단추가 생성됩니다.Javascript Onclick 이벤트를 사용하여 ActiveX Template Coach (TCard) 개체를 만들려고합니다.

현재 DOM Explorer에 따라 개체가 올바른 매개 변수로 만들어졌지만 올바르게 표시되지 않고 단추로 나타나지 않는 IE 11, 10, 9 & 8에서 테스트했습니다.

<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> 

어떤 도움이나 조언을 부탁드립니다. 난 아무것도 해결하지 못하는 ActiveX 용 인터넷 옵션의 보안 옵션을 이미 살펴 보았습니다. 이미 코드에있는 객체를 가지고 있다면 그 것이 나타납니다. 나는 그것이 대상과의 문제가 아니라 창조라는 것을 생각하게 만든다.

참고 : JQuery를 사용할 수 없습니다.

감사합니다.

답변

1

내가 알고있는 한, 이것은 보안 업데이트로 인해 깨졌으며 단추도 마찬가지였다.

2004-2005 년 동안 Windows는 지속적으로 공격을 받았습니다. 많은 보안 취약점을 해결하기 위해 MS는 HTML 도움말의 기능을 로컬 도움말의 기능으로 축소하기로 결정했습니다.

Workshop 도움말은 다음 원격 기능을 문서화하지만 Windows XP 이상에서는 실제로 작동하지 않습니다.

  • HTML 도움말 ActiveX 컨트롤은 HH 뷰어의 기본 도움말 코드 라이브러리 (실행 파일) HHCTRL.OCX에 저장됩니다 . 그래서 이것은 ActiveX 기능이있는 DLL입니다. 보안 업데이트가 있기 전에이 컨트롤을 사용하여 목차와 색인을 웹 페이지에 포함시킬 수 있습니다.
  • HTML 도움말 Java 애플릿 웹 페이지에 탐색 (TOC/색인)을 포함시키는 다른 방법으로 Sun Java를 사용했습니다. Microsoft에 의해 유지 관리 된 적이 없으며 (보안 업데이트가 절실히 필요하기도 전에) 사용할 수없는 상태에 빠졌습니다. 따라서이 기능을 무시하십시오.

몇 년 전에 바로 가기 링크를 사용해 보았습니다. 누락 버튼 교체 ? - 확실 해요! 압축 된 CHM 파일에서만 작동합니다.

<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>