Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Text popups in HtmlHelp
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00256881
Message ID:
00258740
Views:
20
I am still struggling with linking vfp to HTMLhelp.
SET TOPIC ID TO xxxx ; HELP
and
HELP ID xxxx
work ok, but text popups are another matter.

Michael Ross of WordWise solutions
http://www.geocities.com/SiliconValley/Way/3627/
has a VB demo project which shows how to achieve this in VB.
http://www.geocities.com/SiliconValley/Way/3627/htmlhelp/demo.zip

With apologies for length, the following vfp code uses Michael Ross's help and header files to do the same thing. It launches a form with 4 buttons. The syntax is almost identical as in VB, but the results are not.

Button 1: click to open the help file at the default topic - opens the help file then GPFs.
Button 2: click to open a popup topic - nothing happens.
Button 3: click to open a specifed topic - nothing happens.
Button 4: click to open a specifed topic with HELP ID xxxx call - only method that works.

Come on somebody! Can we get it to work???

John Burton
(note: download demo.zip from the above location first.)

***********************************************
#INCLUDE ContextTest.h
#INCLUDE WhatsThis.h

#DEFINE HH_DISPLAY_TOPIC 0x0000
#DEFINE HH_DISPLAY_TEXT_POPUP 0x000E
#DEFINE HH_HELP_CONTEXT 0x000F

PROCEDURE ContextTest
LOCAL oFrm
oFrm = CREATEOBJECT("CONTEXTTESTFORM")
oFrm.Show(1)
ENDPROC

DEFINE CLASS CONTEXTTESTFORM AS FORM

Caption = 'Test help'
AutoCenter = .T.
Width = 120
Height = 140
WhatsThisHelp = .T.
WhatsThisButton = .T.
MaxButton = .F.
MinButton = .F.

CHMfile = ''

ADD OBJECT Command1 AS COMMANDBUTTON WITH Top = 10, Left = 10, ;
Height = 25, Caption = 'Help Contents', ;
WhatsThisHelp = IDH_10002, HelpContextID = IDH_btHelpTopicOne
ADD OBJECT Command2 AS COMMANDBUTTON WITH Top = 40, Left = 10, ;
Height = 25, Caption = 'Text Popup', ;
WhatsThisHelp = IDH_10003, HelpContextID = IDH_btHelpTopicTwo
ADD OBJECT Command3 AS COMMANDBUTTON WITH Top = 70, Left = 10, ;
Height = 25, Caption = 'Context help', ;
WhatsThisHelp = IDH_10004, HelpContextID = IDH_btHelpTopicThree
ADD OBJECT Command4 AS COMMANDBUTTON WITH Top = 100, Left = 10, ;
Height = 25, Caption = 'Help Topic Two', ;
WhatsThisHelp = IDH_10004, HelpContextID = IDH_btHelpTopicTwo

PROCEDURE Init
LOCAL ch
WITH THIS
ch = SUBSTR(JUSTPATH(SYS(16)), AT(SYS(5), JUSTPATH(SYS(16)))) + "\CONTEXTTEST.CHM"
SET HELP TO (ch)
.CHMfile = ch
ENDWITH
ENDPROC

PROCEDURE Command1.Click
THIS.Parent.HelpContents
ENDPROC

PROCEDURE Command2.Click
THIS.Parent.PopupHelp(THIS.WhatsThisHelp)
ENDPROC

PROCEDURE Command3.Click
THIS.Parent.ContextHelp(THIS.HelpContextID)
ENDPROC

PROCEDURE Command4.Click
HELP ID THIS.HelpContextID
ENDPROC

PROCEDURE HelpContents
DECLARE INTEGER HtmlHelp IN HHCTRL.OCX INTEGER, STRING, INTEGER, DOUBLE
DECLARE INTEGER GetActiveWindow IN USER32
= HtmlHelp(GetActiveWindow(), THIS.CHMfile, HH_DISPLAY_TOPIC, 0x0000)
CLEAR DLLS
ENDPROC

PROCEDURE PopupHelp
LPARAMETER nWhatsThisHelp
DECLARE INTEGER HtmlHelp IN HHCTRL.OCX INTEGER, STRING, INTEGER, DOUBLE
DECLARE INTEGER GetActiveWindow IN USER32
= HtmlHelp(GetActiveWindow(), THIS.CHMfile, HH_DISPLAY_TEXT_POPUP, nWhatsThisHelp)
CLEAR DLLS
ENDPROC

PROCEDURE ContextHelp
LPARAMETER nContextID
DECLARE INTEGER HtmlHelp IN HHCTRL.OCX INTEGER, STRING, INTEGER, DOUBLE
DECLARE INTEGER GetActiveWindow IN USER32
= HtmlHelp(GetActiveWindow(), THIS.CHMfile, HH_HELP_CONTEXT, nContextID)
CLEAR DLLS
ENDPROC

ENDDEFINE
******************************
Previous
Reply
Map
View

Click here to load this message in the networking platform