//-----------------------------------------------------------------------//
// This Functions provide a way to execute 32 Bits Help Files from a
// FiveWin Application
// under Windows NT.
// The problem is that FiveWin applications are recognized as 16 Bits
// applications by
// Windows NT, so NT thinks that help file is also 16 bits.
// Vicente Aranzana. 30/09/1.998
// <!-- e --><a href="mailto:varanzan@gruposp.com">varanzan@gruposp.com</a><!-- e -->
// Programa: Help32.prg
//-----------------------------------------------------------------------//
// Notes.
// Those Functions will only work under 32 bits environment.
//-----------------------------------------------------------------------//
#include "FiveWin.ch"
//-----------------------------------------------------------------------//
#Define HELP_CONTEXT 1 // 0x0001
#Define HELP_QUIT 2 // 0x0002
#Define HELP_INDEX 3 // 0x0003
#Define HELP_CONTENTS 3 // 0x0003
#Define HELP_HELPONHELP 4 // 0x0004
#Define HELP_SETINDEX 5 // 0x0005
#Define HELP_SETCONTENTS 5 // 0x0005
#Define HELP_CONTEXTPOPUP 8 // 0x0008
#Define HELP_FORCEFILE 9 // 0x0009
#Define HELP_KEY 257 // 0x0101
#Define HELP_COMMAND 258 // 0x0102
#Define HELP_PARTIALKEY 261 // 0x0105
#Define HELP_MULTIKEY 513 // 0x0201
#Define HELP_SETWINPOS 515 // 0x0203
#Define HELP_FINDER 11 // 0x000b
//-----------------------------------------------------------------------//
Function HelpTopic( nHelpId )
Local cHelpFile := GetHelpFile()
Local cHelpTopic := GetHelpTopic()
If Empty( cHelpFile )
//MsgStop( "Arquivo de Help Não DisponÃvel", " Atenção" )
Return .f.
Endif
If nHelpId != NIL
If ValType( nHelpId ) == "N"
SPWinHelp( GetActiveWindow(), cHelpFile, HELP_CONTEXT, nHelpId )
Else
SPWinHelpC( GetActiveWindow(), cHelpFile, HELP_KEY, nHelpId )
Endif
Else // nHelpId == NIL
SPWinHelpC( GetActiveWindow(), cHelpFile, HELP_KEY, cHelpTopic )
Endif
Return NIL
//-----------------------------------------------------------------------//
Function HelpIndex()
Local cHelpFile := GetHelpFile()
If Empty( cHelpFile )
MsgStop( "Arquivo de Help Não DisponÃvel", " Atenção" )
Return .F.
Endif
SPWinHelp( GetActiveWindow(), cHelpFile, HELP_FINDER, 0 )
Return NIL
//-----------------------------------------------------------------------//
Function HelpSearch( cSearch ) // this is not working it just brings search screen
Local cHelpFile := GetHelpFile()
DEFAULT cSearch := ""
If Empty( cHelpFile )
MsgStop( "Arquivo de Help Não DisponÃvel", " Atenção" )
Return .f.
Endif
SPWinHelpC( GetActiveWindow(), cHelpFile, HELP_PARTIALKEY, cSearch )
Return NIL
//-----------------------------------------------------------------------//
Function HelpPopup( nHelpId )
local cHelpFile := GetHelpFile()
If Empty( cHelpFile )
MsgStop( "Arquivo de Help Não DisponÃvel", " Atenção" )
Return .f.
Endif
SPWinHelp( GetActiveWindow(), cHelpFile, HELP_CONTEXTPOPUP, nHelpId )
Return NIL
//-----------------------------------------------------------------------//
Function WinHelp( cHelpFile, nId, nParams ) // this don't work.
DEFAULT nId := HELP_CONTENTS
DEFAULT nParams := 0
SPWinHelp( GetActiveWindow(), cHelpFile, nId, nParams )
Return NIL
//-----------------------------------------------------------------------//
DLL32 FUNCTION SPWinHelp( HWND AS LONG, cHelpFile AS LPSTR, nId AS LONG,;
nParams AS LONG );
AS BOOL PASCAL FROM "WinHelpA" LIB "User32.dll"
//-----------------------------------------------------------------------//
DLL32 FUNCTION SPWinHelpC( HWND AS LONG, cHelpFile AS LPSTR, nId AS LONG,;
nParams AS LPSTR );
AS BOOL PASCAL FROM "WinHelpA" LIB "User32.dll"