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
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
**************************
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.
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
----------------------------------------------------------------------
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! ;)
"Trevor Magnusson" <trevor...@hotmail.com> wrote in message
news:1153346686.6...@75g2000cwc.googlegroups.com...
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.
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.
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. ;)
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
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.
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.
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...