Silverfrost Forums

Welcome to our forums

Using HTMLHELP with FTN95

16 Jun 2009 5:25 #4710

Can anyone help me with using HTMLHELP api function with Salford fortran?

17 Jun 2009 8:56 #4711

Yes, I started a thread two years back. However, I did not get any feed back after that. I am back to this topic again as I deperatly need to do.

Here is the copy of what I said last time.

Dear Paul,

Thank you very much for the reply. You gave me enough information to start playing with the HtmlHelp API. However, I haven't yet suceeded in producing anything useful.

I have been using winhelp to display selected help topics. Using command like:

LERR=winhelp(ihwnd,'C8INFO.HLP'//char(0),1,I_Topic_ID)

As with Vista, winhelp is not supported anymore, I am now trying to replace winhelp with HtmlHelp commands to display specific help topics from .chm file.

Following code opens a window. However, it does appears immediatly.

STDCALL HTMLHELP 'HtmlHelpA' (VAL,STRING,VAL,VAL):INTEGER4 INTEGER,PARAMETERHH_DISPLAY_TOPIC=Z'0000' INTEGER,PARAMETERHH_HELP_CONTEXT=Z'000F' INTEGER,PARAMETERHH_INITIALIZE=Z'001C' INTEGER,PARAMETERHH_UNINITIALIZE=Z'001D' INTEGER dwCookie LIBRARY 'c:\windows\system32\hhctrl.ocx' dwCookie = 0 i=HtmlHelp(0,0,HH_INITIALIZE,LOC(dwCookie)) print, i, dwCookie i=HTMLHELP(0,'c8_help\c8info.chm'//char(0),HH_DISPLAY_TOPIC,

c + 'html\c8in0001.htm') c i=HTMLHELP(0,'D:\contram\c7\c8_help\c8info.chm',HH_HELP_CONTEXT, c + 1000) write(,)i i=HtmlHelp(0,0,HH_UNINITIALIZE,dwCookie) write(,)i end

Ananda

17 Jun 2009 9:00 #4712

Sorry,

There is correction in my statement in the last post

'Following code opens a window. However, it does appears immediatly.'

should be replaced as

'Following code opens a window. However, it does disappears immediatly.'

Ananda

17 Jun 2009 10:58 #4713

Ananda

There are two problems with your code.

  1. You need a pause statement of some kind in the code otherwise the help window closes immediately.

  2. You need to run it as a windows program (WINAPP).

       WINAPP
       STDCALL HtmlHelp 'HtmlHelpA' (VAL,STRING,VAL,VAL):INTEGER*4
       STDCALL GetDesktopWindow 'GetDesktopWindow':INTEGER*4 
       INTEGER,PARAMETER::HH_DISPLAY_TOPIC=Z'0000' 
       INTEGER,PARAMETER::HH_INITIALIZE=Z'001C' 
       INTEGER,PARAMETER::HH_UNINITIALIZE=Z'001D' 
       CHARACTER(*),PARAMETER::hf='C:\\DemoBrowser\\Install\\Files\\vcw.chm' 
       INTEGER dwCookie,hwnd 
       LIBRARY 'c:\\windows\\system32\\hhctrl.ocx'
       hwnd = GetDesktopWindow()
       i=HtmlHelp(0,0,HH_INITIALIZE,LOC(dwCookie)) 
       i=HtmlHelp(hwnd,hf,HH_DISPLAY_TOPIC,0)
       i=winio@('%bt[Exit]')
       i=HtmlHelp(0,0,HH_UNINITIALIZE,dwCookie) 
       end 
    
17 Jun 2009 12:32 #4714

Dear Paul,

Thank you very much for your reply. It is working. Now I need to play with the code to select a specfic topic on demand.

Ananda

23 Jun 2009 12:19 #4718

There is a MUCH, MUCH, easier way to use hypertext help. This is the menu stuff:

       IA=WINIO@('%mn[&Help[User manual...]]&',  Manual_Function) 
       IA=WINIO@('%mn[[|,&About Program]]&',     About_Function) 

Manual_Function looks like this:

      INTEGER FUNCTION Manual_Function()
      INCLUDE <WINDOWS.INS>
      CALL START_PPROCESS@('HH.EXE','Helpfile.chm')
      Manual_Function = 1
      END

All you need to do is launch your help file as the 'data' for the WIndows Hypertext Help viewer.

Creating chm files with searchable indexes, contents lists etc is tedious, but can be done with free software, for example HelpMaker from Vizacc.com

Regards

Eddie

4 Jul 2009 7:34 #4751

Eddie

You are right in saying that your method is much easier but calling HtmlHelp, in theory, allows you to directly access given topics etc.

5 Jul 2009 4:50 #4752

Paul,

MSDN reckons that you can access given topics in a .chm file using HH.EXE ....

Eddie

Please login to reply.