Module Winhlp.pkg
1//************************************************************************
2// Confidential Trade Secret.
3// Copyright (c) 1997 Data Access Corporation, Miami Florida
4// as an unpublished work. All rights reserved.
5// DataFlex is a registered trademark of Data Access Corporation.
6//
7//************************************************************************
8//
9// $File name : WinHlp.pkg
10// $File title : Windows Help support for 95
11// Notice :
12// $Author(s) : John Tuohy, Ken Ross
13//
14// $Rev History
15//
16// JT 06/27/97 File created
17// JT 10/13/98 Fixed bug - context string help not working! Pass Help_ParitalKey
18//************************************************************************
19// This provides a single call global procedure call to get windows help.
20//
21// Send gDoWinHelp iHelpType {sHelpFile {String sContext}}
22//
23// Where iHelpType can be:
24// WH_STRINGCONTEXT - find by passed context keyword string
25// WH_INTCONTEXT - find by passed context integer id
26// WH_FINDER - load help topics dialog
27// WH_HELPONHELP - windows help on help
28//
29// This is used by DfHlpCl.pkg (HelpSystem class) to make a API call. You are encouraged to use the
30// messages provided by the HelpSystem class. You ARE STRONGLY DISCOURAGED from making direct
31// calls to gDoWinHelp!
32//
33
34Use DLL.pkg
35
36// Commands to pass WinHelp
37//
38#REPLACE HELP_WCONTEXT |CI$0001 // Display topic in ulTopic (symbol HELP_CONTEXT already used)
39#REPLACE HELP_QUIT |CI$0002 // Terminate help
40#REPLACE HELP_CONTENTS |CI$0003 // Display contents - use HELP_FINDER instead
41#REPLACE HELP_WINDEX |CI$0003 // Display index - use HELP_FINDER instead (HELP_INDEX aleady used)
42#REPLACE HELP_HELPONHELP |CI$0004 // Display help on using help
43#REPLACE HELP_SETINDEX |CI$0005 // Set the current Index for multi index help
44#REPLACE HELP_SETCONTENTS |CI$0005
45#REPLACE HELP_CONTEXTPOPUP |CI$0008
46#REPLACE HELP_FORCEFILE |CI$0009
47#REPLACE HELP_CONTEXTMENU |CI$000A
48#REPLACE HELP_FINDER |CI$000B
49#REPLACE HELP_WM_HELP |CI$000C
50#REPLACE HELP_SETPOPUP_POS |CI$000D
51#REPLACE HELP_KEY |CI$0101 // Display topic for keyword in offabData
52#REPLACE HELP_COMMAND |CI$0102
53#REPLACE HELP_PARTIALKEY |CI$0105
54#REPLACE HELP_MULTIKEY |CI$0201
55#REPLACE HELP_SETWINPOS |CI$0203
56
57#REPLACE HELP_TCARD |CI$8000
58#REPLACE HELP_TCARD_DATA |CI$0010
59#REPLACE HELP_TCARD_OTHER_CALLER |CI$0011
60
61// Call Windows Help engine with string parameter (for searching)
62//
63External_Function WinHelpStr "WinHelpA" user32.dll HANDLE hWnd STRING HelpFile DWORD cmnd STRING str RETURNS Integer
64
65// Call Windows Help engine with dword parameter (for context ID)
66//
67External_Function WinHelpCntx "WinHelpA" user32.dll HANDLE hWnd STRING HelpFile DWORD cmnd DWORD cntx RETURNS Integer
68
69ENUMERATION_LIST
70 define WH_STRINGCONTEXT // find by context string
71 define WH_INTCONTEXT // find by context integer id
72 define WH_FINDER // load help topics dialog
73 define WH_HELPONHELP // help on help
74END_ENUMERATION_LIST
75
76// Protected Global message: Use with care
77// Displays help topic from sHelpFile based on a string context.
78//
79{ Visibility=Private }
80Procedure gDoWinHelp GLOBAL integer iHelpType String sHelpFile String sContext
81 Integer iVal
82 If (sHelpFile<>"") Begin
83 If (iHelpType = WH_STRINGCONTEXT) Move (WinHelpStr(0, sHelpFile, HELP_PARTIALKEY, sContext)) to iVal
84 Else If (iHelpType = WH_INTCONTEXT) Move (WinHelpCntx(0, sHelpFile, HELP_WCONTEXT, sContext)) to iVal
85 Else If (iHelpType = WH_FINDER) Move (WinHelpCntx(0, sHelpFile, HELP_FINDER, 0)) to iVal
86 Else If (iHelpType = WH_HELPONHELP) Move (WinHelpCntx(0, "", HELP_HELPONHELP, 0)) to iVal
87 End
88End_Procedure
89