Button to close the chm
Button to close the chm
How do I create a button for the user to close (exit) the chm? I image it must be a shortcut control but I've not found any help for the parameters to be sent or the "standard windows message."
Windows XP, Flare 4.0, HTML help, need not work over a network.
Thanks,
Roger
Data I/O
Windows XP, Flare 4.0, HTML help, need not work over a network.
Thanks,
Roger
Data I/O
Re: Button to close the chm
If it's for HTML Help then it can't work over the network.
Are you saying you want to create a custom button that says something like "Close Help" and you want to know how to format the command?
Are you saying you want to create a custom button that says something like "Close Help" and you want to know how to format the command?
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
-
Pete Lees
- Sr. Propeller Head
- Posts: 150
- Joined: Thu Feb 09, 2006 12:33 pm
- Location: Bracknell, Berkshire, UK
Re: Button to close the chm
Hi, Roger,
If you can make a topic file like the one below the target of your custom toolbar button, the help window will close when the user clicks the button.
And see also this discussion in another forum for ways to make the help window close when the user presses the Esc key:
http://www.adobe.com/cfusion/webforums/ ... id=1339304
Pete
If you can make a topic file like the one below the target of your custom toolbar button, the help window will close when the user clicks the button.
Code: Select all
<html>
<body onload="JavaScript:Close.Click()">
<object id="Close" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="Command" value="Close">
</object>
</body>
</html>http://www.adobe.com/cfusion/webforums/ ... id=1339304
Pete
Re: Button to close the chm
Lisa, you got it. That's what I want.
Pete, I think what you are suggesting is a new topic that closes the help when that topic opens. I am putting the 'Close' button in a topic rather than in the button bar, but that shouldn't make a difference. I tried your suggestion (copying your code into the page via the internal editor) and when I attempt to save the new topic I get this error message: [XML: The 'param" start tag on line 9 does not lmatch the end tab of 'object'. Line 10, position 7.]
Pete, I think what you are suggesting is a new topic that closes the help when that topic opens. I am putting the 'Close' button in a topic rather than in the button bar, but that shouldn't make a difference. I tried your suggestion (copying your code into the page via the internal editor) and when I attempt to save the new topic I get this error message: [XML: The 'param" start tag on line 9 does not lmatch the end tab of 'object'. Line 10, position 7.]
-
KevinDAmery
- Propellus Maximus
- Posts: 1985
- Joined: Tue Jan 23, 2007 8:18 am
- Location: Darn, I knew I was around here somewhere...
Re: Button to close the chm
Did you copy everything? Specifically, you would need to add the java script declaration in the Body tag plus the entire object tag group. The error you're quoting makes it sound like the opening object tag isn't there.
Until next time....

Kevin Amery
Certified MAD for Flare
Kevin Amery
Certified MAD for Flare
-
Pete Lees
- Sr. Propeller Head
- Posts: 150
- Joined: Thu Feb 09, 2006 12:33 pm
- Location: Bracknell, Berkshire, UK
Re: Button to close the chm
Here's an alternative version, which adds a Close button to your topic content.
Like the earlier version, this uses the Close command of the HTML Help ActiveX control to close the window. I don't think that any other script or control can achieve the same result.
No idea why you were getting the error message, unless it's because the Flare editor assumes that the <param> tag requires an end-tag (which it doesn't). Still, it doesn't do any harm to close the parameter with a forward slash in the same tag (<param name="Command" value="Close"/>).
Pete
Code: Select all
<html>
<body>
<-- The rest of your topic content... -->
<object id="hhctrl" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="Command" value="Close">
<param name="Button" value="Text:Close">
</object>
</body>
</html>
No idea why you were getting the error message, unless it's because the Flare editor assumes that the <param> tag requires an end-tag (which it doesn't). Still, it doesn't do any harm to close the parameter with a forward slash in the same tag (<param name="Command" value="Close"/>).
Pete
Last edited by Pete Lees on Tue Oct 14, 2008 10:02 am, edited 1 time in total.
-
doc_guy
- Propellus Maximus
- Posts: 1979
- Joined: Tue Nov 28, 2006 11:18 am
- Location: Crossroads of the West
- Contact:
Re: Button to close the chm
XML won't validate unless EVERY opening tag has a closing tag. So, yes, the <param> will need a closing slash to be valid XML.
That is why in Flare, you never see a <br> element. You always see a <br /> element. Same applies to the <param> element.
That is why in Flare, you never see a <br> element. You always see a <br /> element. Same applies to the <param> element.
-
doc_guy
- Propellus Maximus
- Posts: 1979
- Joined: Tue Nov 28, 2006 11:18 am
- Location: Crossroads of the West
- Contact:
Re: Button to close the chm
So, for the sake of clarity, use the following example:
and see if that works.
Code: Select all
<html>
<body>
<-- The rest of your topic content... -->
<object id="hhctrl" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="Command" value="Close" />
<param name="Button" value="Text:Close" />
</object>
</body>
</html>Re: Button to close the chm
Yes. It works perfectly. That could otherwise have taken my days to figure out. I wish MadCap Flare's Help could point to resources like this.
Thanks, Pete and Paul.
Roger
Thanks, Pete and Paul.
Roger
-
doc_guy
- Propellus Maximus
- Posts: 1979
- Joined: Tue Nov 28, 2006 11:18 am
- Location: Crossroads of the West
- Contact:
Re: Button to close the chm
Ah, but if the help system had the info, then we wouldn't have anything to do in the forums!
Glad it worked.
-
Richard Ferrell
- Propellus Maximus
- Posts: 840
- Joined: Mon May 01, 2006 10:11 am
- Location: Inside California
Re: Button to close the chm
Thanks for the suggestion, Normally Custom Javascript and buttons would be out side the scope of support, as there are many different ways to do something like this, and it would be very difficult to support.
I will submit a feature request to our dev team for more support for custom buttons and scripts.
I will submit a feature request to our dev team for more support for custom buttons and scripts.
Richard Ferrell
Certified Madcap Trainer

Certified Madcap Trainer
Re: Button to close the chm
That would be great-- at least for a few common features like close buttons, open a second chm, printing several or all pages in chm, or whatever folks request often.Richard Ferrell wrote: I will submit a feature request to our dev team for more support for custom buttons and scripts.
Roger
