1. How do I launch a .hlp file from a Euphoria windows program?

I was wondering how to start a Microsoft Windows hlp file from a Euphoria
windows program?

I noticed that people are using HTML for help, even in Euphoria. So, should I be
writing help in that form?

Andy Katz

B.S. Computer Science, 1978
Rensselaer Polytechnic Institute (RPI)

new topic     » topic index » view message » categorize

2. Re: How do I launch a .hlp file from a Euphoria windows program?

Hi,

Can you do something like this?

atom r

-- I want to open ssgk2.hlp
r=system_exec("winhlp32 ssgk2.hlp",0)


I'm not a Windows expert so please excuse me if the solution 
is too much simple.... Perhaps you could do something better
using Win32lib!

Leonardo

new topic     » goto parent     » topic index » view message » categorize

3. Re: How do I launch a .hlp file from a Euphoria windows program?

--simplest, gethelp.exw--
include dll.e
include machine.e

constant
 HELP_CONTENTS=3
,USER32=open_dll("user32")
,WinHelpA=define_c_func(USER32,"WinHelpA",
   {C_UINT,C_UINT,C_UINT,C_UINT},C_UINT)
 --handle,string-ptr,type,additional

atom helpfile, ret
helpfile=allocate_string("iexplore.hlp") --your filename
ret=c_func(WinHelpA,{0,helpfile,HELP_CONTENTS,0})
free(helpfile)
--end--

new topic     » goto parent     » topic index » view message » categorize

4. Re: How do I launch a .hlp file from a Euphoria windows program?

In wxEuphoria I use:

atom void

--for compiled html help (.chm) files
void = wx_execute("hh.exe helpfile.chm",wxEXEC_SYNC)

--for windows help (.hlp) files
void = wx_execute("winhlp32.exe helpfile.hlp",wxEXEC_SYNC)


Leonardo Cecchi <guest at RapidEuphoria.com> wrote on 04/02/2007 11:05:30 AM:

>
>
> posted by: Leonardo Cecchi <leonardoce at interfree.it>
>
> Hi,
>
> Can you do something like this?
>
> }}}
<eucode>
> atom r
>
> -- I want to open ssgk2.hlp
> r=system_exec("winhlp32 ssgk2.hlp",0)
> </eucode>
{{{

>
> I'm not a Windows expert so please excuse me if the solution
> is too much simple.... Perhaps you could do something better
> using Win32lib!
>
> Leonardo
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

5. Re: How do I launch a .hlp file from a Euphoria windows program?

Andrew Katz wrote:
> 
> I was wondering how to start a Microsoft Windows hlp file from a Euphoria
> windows
> program?
> 
> I noticed that people are using HTML for help, even in Euphoria. So, should
> I be writing help in that form?
> 

To launch a compilied HTML (chm) help file, I use this include (hh.ew - not sure
who wrote it or where I found it so apologies to the author..)

-- HtmlHelp function for opening context sensitive help
include w32support.e

constant 
  HH = open_dll( "hhctrl.ocx" ),
HtmlHelp = define_c_func( HH, "HtmlHelpA", {C_POINTER, C_POINTER, C_UINT,
  C_LONG}, C_POINTER)

-- Commands to pass to HtmlHelp()
global constant
HH_DISPLAY_TOPIC        = #0000,  -- i.e. format for 'file' =
  "myHelp.chm::\\topic1.htm" ('data' = NULL)
  HH_HELP_FINDER          = #0000,  -- WinHelp equivalent
  HH_DISPLAY_TOC          = #0001,
  HH_DISPLAY_INDEX        = #0002,
  HH_DISPLAY_SEARCH       = #0003,
  HH_SET_WIN_TYPE         = #0004,
  HH_GET_WIN_TYPE         = #0005,
  HH_GET_WIN_HANDLE       = #0006,
HH_ENUM_INFO_TYPE       = #0007,  -- Get Info type name, call repeatedly to
  enumerate, -1 at end
  HH_SET_INFO_TYPE        = #0008,  -- Add Info type to filter.
  HH_SYNC                 = #0009,
  HH_RESERVED1            = #000A,
  HH_RESERVED2            = #000B,
  HH_RESERVED3            = #000C,
  HH_KEYWORD_LOOKUP       = #000D,
HH_DISPLAY_TEXT_POPUP   = #000E,  -- display string resource id or text in a
  popup window
  HH_HELP_CONTEXT         = #000F,  -- display mapped numeric value in dwData
HH_TP_HELP_CONTEXTMENU  = #0010,  -- text popup help, same as WinHelp
  HELP_CONTEXTMENU
HH_TP_HELP_WM_HELP      = #0011,  -- text popup help, same as WinHelp
  HELP_WM_HELP
HH_CLOSE_ALL            = #0012,  -- close all windows opened directly or
  indirectly by the caller
  HH_ALINK_LOOKUP         = #0013,  -- ALink version of HH_KEYWORD_LOOKUP
HH_GET_LAST_ERROR       = #0014,  -- not currently implemented -- See
  HHERROR.h
HH_ENUM_CATEGORY        = #0015,	-- Get category name, call repeatedly to
  enumerate, -1 at end
HH_ENUM_CATEGORY_IT     = #0016,  -- Get category info type members, call
  repeatedly to enumerate, -1 at end
HH_RESET_IT_FILTER      = #0017,  -- Clear the info type filter of all info
  types.
HH_SET_INCLUSIVE_FILTER = #0018,  -- set inclusive filtering method for
  untyped topics to be included in display
HH_SET_EXCLUSIVE_FILTER = #0019,  -- set exclusive filtering method for
  untyped topics to be excluded from display
  HH_INITIALIZE           = #001C,  -- Initializes the help system.
  HH_UNINITIALIZE         = #001D,  -- Uninitializes the help system.
  HH_PRETRANSLATEMESSAGE  = #00FD,  -- Pumps messages. (NULL, NULL, MSG*).
HH_SET_GLOBAL_PROPERTY  = #00FC   -- Set a global property. (NULL, NULL,
  HH_GPROP)
  
-- structure HH_AKLINK
constant
  cbStruct     = w32allot( Long ), -- sizeof this structure
  fReserved    = w32allot( Long ), -- must be FALSE (really!)
  pszKeywords  = w32allot( Lpsz ), -- semi-colon separated keywords
pszURL       = w32allot( Lpsz ), -- URL to jump to if no keywords found (may
  be NULL)
pszMsgText   = w32allot( Lpsz ), -- Message text to display in MessageBox if
  pszUrl is NULL and no keyword match
pszMsgTitle  = w32allot( Lpsz ), -- Message text to display in MessageBox if
  pszUrl is NULL and no keyword match
  pszWindow    = w32allot( Lpsz ), -- Window to display URL in
  fIndexOnFail = w32allot( Long ), -- Displays index if keyword lookup fails.
  SIZEOF_HH_AKLINK = w32allotted_size()
  ------------------------------
global function htmlHelp( atom hwndCaller, object file, integer command, object
data )
  atom pszFile, ret, aklink

  if sequence(file) then
    pszFile = allocate_string(file)
  else
    pszFile = file
  end if
  if command = HH_ALINK_LOOKUP or command = HH_KEYWORD_LOOKUP then
    aklink = w32acquire_mem(0,SIZEOF_HH_AKLINK)
    w32store(aklink,cbStruct,SIZEOF_HH_AKLINK)
    w32store(aklink,pszKeywords,data)
    w32store(aklink,fIndexOnFail,1)
    ret = c_func(HtmlHelp,{hwndCaller,pszFile,command,aklink})
    w32release_mem(aklink)
  else
    ret = c_func(HtmlHelp,{hwndCaller,pszFile,command,data})
  end if
  if sequence(file) then
    free( pszFile )
  end if
  return ret
end function


Then call it with..
-- returns 0 if failure
 helpRes = htmlHelp( getHandle(OwningWindowName), 
         full_path_to_.chm file::\\MainScreen.htm", HH_DISPLAY_TOC, NULL)

with the "::MainScreen.htm" it will open the chm file at that page, so you can
easily have context sensitive help by opening at the appropriate page..

Regards PeteS

new topic     » goto parent     » topic index » view message » categorize

6. Re: How do I launch a .hlp file from a Euphoria windows program?

Pete Stoner wrote:
> 
> Andrew Katz wrote:
> > 
> > I was wondering how to start a Microsoft Windows hlp file from a Euphoria
> > windows
> > program?
> > 
> > I noticed that people are using HTML for help, even in Euphoria. So, should
> > I be writing help in that form?
> > 
> 
> To launch a compilied HTML (chm) help file, I use this include (hh.ew - not
> sure who wrote it or where I found it so apologies to the author..)
> 
> }}}
<eucode>
> -- HtmlHelp function for opening context sensitive help
> include w32support.e
> 
> constant 
>   HH = open_dll( "hhctrl.ocx" ),
>   HtmlHelp = define_c_func( HH, "HtmlHelpA", {C_POINTER, C_POINTER, C_UINT,
>   C_LONG}, C_POINTER)
> 
> -- Commands to pass to HtmlHelp()
> global constant
>   HH_DISPLAY_TOPIC        = #0000,  -- i.e. format for 'file' =
>   "myHelp.chm::\\topic1.htm" ('data' = NULL)
>   HH_HELP_FINDER          = #0000,  -- WinHelp equivalent
>   HH_DISPLAY_TOC          = #0001,
>   HH_DISPLAY_INDEX        = #0002,
>   HH_DISPLAY_SEARCH       = #0003,
>   HH_SET_WIN_TYPE         = #0004,
>   HH_GET_WIN_TYPE         = #0005,
>   HH_GET_WIN_HANDLE       = #0006,
>   HH_ENUM_INFO_TYPE       = #0007,  -- Get Info type name, call repeatedly to
>   enumerate, -1 at end
>   HH_SET_INFO_TYPE        = #0008,  -- Add Info type to filter.
>   HH_SYNC                 = #0009,
>   HH_RESERVED1            = #000A,
>   HH_RESERVED2            = #000B,
>   HH_RESERVED3            = #000C,
>   HH_KEYWORD_LOOKUP       = #000D,
>   HH_DISPLAY_TEXT_POPUP   = #000E,  -- display string resource id or text in a
>   popup window
>   HH_HELP_CONTEXT         = #000F,  -- display mapped numeric value in dwData
>   HH_TP_HELP_CONTEXTMENU  = #0010,  -- text popup help, same as WinHelp
>   HELP_CONTEXTMENU
>   HH_TP_HELP_WM_HELP      = #0011,  -- text popup help, same as WinHelp
>   HELP_WM_HELP
>   HH_CLOSE_ALL            = #0012,  -- close all windows opened directly or
>   indirectly by the caller
>   HH_ALINK_LOOKUP         = #0013,  -- ALink version of HH_KEYWORD_LOOKUP
>   HH_GET_LAST_ERROR       = #0014,  -- not currently implemented -- See
>   HHERROR.h
>   HH_ENUM_CATEGORY        = #0015,	-- Get category name, call repeatedly to
>   enumerate, -1 at end
>   HH_ENUM_CATEGORY_IT     = #0016,  -- Get category info type members, call
>   repeatedly to enumerate, -1 at end
>   HH_RESET_IT_FILTER      = #0017,  -- Clear the info type filter of all info
>   types.
>   HH_SET_INCLUSIVE_FILTER = #0018,  -- set inclusive filtering method for
>   untyped topics to be included in display
>   HH_SET_EXCLUSIVE_FILTER = #0019,  -- set exclusive filtering method for
>   untyped topics to be excluded from display
>   HH_INITIALIZE           = #001C,  -- Initializes the help system.
>   HH_UNINITIALIZE         = #001D,  -- Uninitializes the help system.
>   HH_PRETRANSLATEMESSAGE  = #00FD,  -- Pumps messages. (NULL, NULL, MSG*).
>   HH_SET_GLOBAL_PROPERTY  = #00FC   -- Set a global property. (NULL, NULL,
>   HH_GPROP)
>   
> -- structure HH_AKLINK
> constant
>   cbStruct     = w32allot( Long ), -- sizeof this structure
>   fReserved    = w32allot( Long ), -- must be FALSE (really!)
>   pszKeywords  = w32allot( Lpsz ), -- semi-colon separated keywords
>   pszURL       = w32allot( Lpsz ), -- URL to jump to if no keywords found (may
>   be NULL)
>   pszMsgText   = w32allot( Lpsz ), -- Message text to display in MessageBox if
>   pszUrl is NULL and no keyword match
>   pszMsgTitle  = w32allot( Lpsz ), -- Message text to display in MessageBox if
>   pszUrl is NULL and no keyword match
>   pszWindow    = w32allot( Lpsz ), -- Window to display URL in
>   fIndexOnFail = w32allot( Long ), -- Displays index if keyword lookup fails.
>   SIZEOF_HH_AKLINK = w32allotted_size()
>   ------------------------------
> global function htmlHelp( atom hwndCaller, object file, integer command,
> object data )
>   atom pszFile, ret, aklink
> 
>   if sequence(file) then
>     pszFile = allocate_string(file)
>   else
>     pszFile = file
>   end if
>   if command = HH_ALINK_LOOKUP or command = HH_KEYWORD_LOOKUP then
>     aklink = w32acquire_mem(0,SIZEOF_HH_AKLINK)
>     w32store(aklink,cbStruct,SIZEOF_HH_AKLINK)
>     w32store(aklink,pszKeywords,data)
>     w32store(aklink,fIndexOnFail,1)
>     ret = c_func(HtmlHelp,{hwndCaller,pszFile,command,aklink})
>     w32release_mem(aklink)
>   else
>     ret = c_func(HtmlHelp,{hwndCaller,pszFile,command,data})
>   end if
>   if sequence(file) then
>     free( pszFile )
>   end if
>   return ret
> end function
> </eucode>
{{{

> 
> Then call it with..
> }}}
<eucode>
> -- returns 0 if failure
>  helpRes = htmlHelp( getHandle(OwningWindowName), 
>          full_path_to_.chm file::\\MainScreen.htm", HH_DISPLAY_TOC, NULL)
> </eucode>
{{{

> with the "::MainScreen.htm" it will open the chm file at that page, so you can
> easily have context sensitive help by opening at the appropriate page..
> 
> Regards PeteS

This include file is part of the "Euphoria 2.5 Documentation as Compiled HTML"
 submitted by Brian Broker on 03/10/05. I had to search the forum first,
 and an old post by Rad put me on the right track for finding it.

CChris

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu