Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

hhctrl.ocx, hh.exe and Ctrl/F

85 views
Skip to first unread message

Trevor Magnusson

unread,
Jul 19, 2006, 6:04:46 PM7/19/06
to
Hi,

my Delphi app displays help (stored in a .CHM file) by calling the
hhctrl.ocx HtmlHelpA() function:
First with HH_INITIALIZE (passing NULL as the caller window)
Then with HH_DISPLAY_TOPIC
This creates and displays a window with the requested topic, as
expected. However, in the right-hand pane of this window, I cannot use
Ctrl/F to search for a piece of text *within* the displayed topic - the
Ctrl/F is ignored.

As an alternative, I can display the required help topic by calling
CreateProcess() to launch HH.EXE. This also displays the requested
topic, and in this window Ctfl/F works just fine.
However, launching HH.EXE creates a new window each time - it doesn't
reuse an existing window if one is showing, like HtmlHelp() does.

Is there any way of displaying a topic stored in a .CHM file that takes
notice of Ctrl/F, and also reuses an existing htmlhelp window if one is
already showing?

thank,
Trevor Magnusson
www.cloneensemble.com

Ulrich Kulle

unread,
Jul 20, 2006, 4:56:02 AM7/20/06
to
Hello Trevor,

I'm not a Delphi programmer but tried from command line and get secondary
window like your CreateProcess() call:
HH.EXE -mapid 10010 ms-its:C:/_working/CHM-example.chm
download example from:
http://www.help-info.de/en/Help_Info_HTMLHelp/hh.htm

The CTRL+F is not working for me in the way you described.
AFAIK - this is only working if you click the topic pane *first* and then
press CTRL+F.

Is this a difference in the two cases you described - means you click *or
not* click the topic first?

Post again and I'll try HH_DISPLAY_TOPIC later for VB6 or VB2005 calls.

You know there is a "Search" (in German "Suchen") tab like shown in this
sample:
http://www.help-info.de/en/Help_Info_HTMLHelp/hh_fts.htm

HTH
Best regards
Ulrich Kulle
**************************
http://www.help-info.de
**************************

trevor...@hotmail.com

unread,
Jul 20, 2006, 5:44:13 PM7/20/06
to
> Is this a difference in the two cases you described - means you click *or
> not* click the topic first?

Hi Ulrich,

In both cases (hhctrl.ocx & hh.exe) I first click in the right-hand
pane. Even then, ctrlf/F is ignored under hhctrl.ocx.

In both cases (hhctrl.ocx & hh.exe), there is a "search" tab on the
left-hand pane. However, it searches the *whole document*, not the
current topic (Ctrl/F - when it works - searches the within the current
topic).

One issue that I did not mention in my first post: if I use hhctrl.ocx,
but do NOT start with a call to HH_INITIALIZE, then Ctrl/F works -
however, the system is not stable - some topics fail to display. My
conclusion was this was a bug, and I must call HH_INITIALIZE to fix it.

Thorsten Albers

unread,
Jul 20, 2006, 8:34:22 PM7/20/06
to
Trevor Magnusson <trevor...@hotmail.com> schrieb im Beitrag
<1153346686.6...@75g2000cwc.googlegroups.com>...

> my Delphi app displays help (stored in a .CHM file) by calling the
> hhctrl.ocx HtmlHelpA() function:

Why the hell do you ask a question about an application coded with Borland
Delphi in connection with HTML help files in newsgroups related to
MS Visual C (MFC)
and
MS Visual VB?

--
----------------------------------------------------------------------
THORSTEN ALBERS Universität Freiburg
albers@
uni-freiburg.de
----------------------------------------------------------------------

trevor...@hotmail.com

unread,
Jul 20, 2006, 10:01:55 PM7/20/06
to
> Why the hell do you ask a question about an application coded with Borland
> Delphi in connection with HTML help files in newsgroups related to
> MS Visual C (MFC)
> and
> MS Visual VB?

Thank you for your concern. I chose these groups because I am seeking
expertise in driving hhctrl.ocx. I think we can both agree we would not
find that expertise in any of the Delphi groups! ;)

Rob Cavicchio [MVP]

unread,
Jul 19, 2006, 10:12:16 PM7/19/06
to
I find you actually have to click in the topic pane before CTRL+F will do
anything. Have you been doing that?


"Trevor Magnusson" <trevor...@hotmail.com> wrote in message
news:1153346686.6...@75g2000cwc.googlegroups.com...

trevor...@hotmail.com

unread,
Jul 21, 2006, 1:30:28 AM7/21/06
to
> I find you actually have to click in the topic pane before CTRL+F will do
> anything. Have you been doing that?

Thanks - yes we have been doing that.

When I first started using hhctrl.ocx, I wasn't calling HH_INITIALIZE -
I was jumping right in with a HH_DISPLAYTOPIC. In a small percentage of
cases this would raise an exception, but for remaining cases Ctrl/F
worked just fine.

When I started calling HH_INITIALIZE first, Ctrl/F stopped working.

This is repeatable and stable behaviour on both W2K and XP.

Thorsten Albers

unread,
Jul 21, 2006, 1:28:56 AM7/21/06
to
trevor...@hotmail.com schrieb im Beitrag
<1153447315.0...@h48g2000cwc.googlegroups.com>...

> Thank you for your concern. I chose these groups because I am seeking
> expertise in driving hhctrl.ocx. I think we can both agree we would not
> find that expertise in any of the Delphi groups! ;)

I can't see any reason why a question about "HtmlHelpA()" or "Ctrl/F"
should be answered in a Delphi group less experienced. I think we can both
agree that neither "HtmlHelpA()" nor "Ctrl/F" depends in any kind on VC,
VB, or COM.

trevor...@hotmail.com

unread,
Jul 21, 2006, 3:17:21 AM7/21/06
to
> Is there any way of displaying a topic stored in a .CHM file that takes
> notice of Ctrl/F, and also reuses an existing htmlhelp window if one is
> already showing?

My latest experiments indicate:
Callig HH_INITIALIZE causes hhctrl.ocx to run in the application's main
thread. Therefore, my problem *could* be caused by the Delphi app's
main WndProc loop doing something that prevents the htmlhelp window
from seeing the Ctrl/F.

If this is the case, I apologise to anyone who is offended by my
cross-posting a Delphi-related topic. ;)

J French

unread,
Jul 21, 2006, 4:07:50 AM7/21/06
to

I suggest that you set up a really simple project (two buttons) to
check that

Another option is to sling HTML Help entirely and use the THTML
component from Dave Baldwin to make your own Help System


trevor...@hotmail.com

unread,
Jul 23, 2006, 10:47:00 PM7/23/06
to
> My latest experiments indicate:
> Callig HH_INITIALIZE causes hhctrl.ocx to run in the application's main
> thread. Therefore, my problem *could* be caused by the Delphi app's
> main WndProc loop doing something that prevents the htmlhelp window
> from seeing the Ctrl/F.

Update - by hooking into the app's main windows message loop, and
calling HH_PRETRANSLATEMESSAGE, I am able to achive the correct
behaviour.

It's a pain to have to do this, but it's what MSDN suggests, and it
does solve the problem.

J French

unread,
Jul 24, 2006, 3:07:20 AM7/24/06
to

Interesting, it might be an idea to wrap all that up in a really small
Delphi EXE that you can communicate with from your real App.

Rob Chandler [MVP]

unread,
Jul 24, 2006, 7:35:29 AM7/24/06
to
Trevor
Appologies for coming in so late in this discussion thread.
(you may have seen the Delphi HH code on my site - but I don't
think I ever bothered with HH_PRETRANSLATEMESSAGE)

my 2c... If all you want to do is embed a CHM Help Topic in
your application (with no TOC etc) then simply embed TBrowser (IE6)
instead and navigate to the CHM topic. Very simply and may fix your problem.
Rob

PS. Sorry didn't read the entire thread (cause its kids bed time and time is
limited)

--
Rob Chandler
MS Help MVP
http://Helpware.net
http://mshelpwiki.com

<trevor...@hotmail.com> wrote in message
news:1153709220....@b28g2000cwb.googlegroups.com...

0 new messages