Re: WinHelp Help Please
Nate Brooman wrote:
>
> Yes, acually I have got it to work, with Liberty BASIC and Euphoria. You
> have to search your system to find the "area" which calls WinHelp. I don't
> have any source code to it, because I don't use WinHelp. Goto
> http://world.std.com/~carlg/ and download Liberty BASIC and look at the
> examples "calldll*.bas". Shouldn't be hard to port the code to Euphoria.
>
Thanks, Nate!
This helped a lot: I translated the Liberty Basic code to Euphoria, and
can now call the WinHelp engine. click on a help file, and get help.
I next have to work out haow to send messages to the help window
regarding context, etc.
By the way, whoever writes the Euphoria Windows IDE and wrapper could
learn a lot from Liberty - it's really clear and simple.
Here's what I've got so far:
------winhelp.e------
include dll.e
include machine.e
include misc.e
atom winexec,user32,kernel32
integer winhlp_id
if platform() = WIN32 then
user32 = open_dll("user32.dll")
if user32 = 0 then
puts(1,"Error opening user32.dll\n")
abort(1)
end if
kernel32 = open_dll("kernel32.dll")
winexec = define_c_func(kernel32,"WinExec",{C_INT,C_INT},C_INT)
if winexec = -1 then
puts(1,"Error registering WinExec\n")
abort(2)
end if
winhlp_id =
if winhlp_id = -1 then
puts(2, "Error registering WinHelpA\n")
abort(1)
end if
end if
global procedure GetHelp(atom hwnd, -- handle of owner window
sequence FileName, --help file
atom command, -- type of help needed
atom data) -- value related to type of command
atom pStr, start
pStr = allocate_string("WinHelp") -- (-x runs it in the background)
start = c_func(winexec,{pStr,0}) -- run WinHelp
-- how to pass messages to the help engine ??
free(pStr)
end procedure
Regards,
Irv
|
Not Categorized, Please Help
|
|