Page 1 of 1
Como inhibo F1
Posted: Tue Jan 05, 2010 10:35 pm
by gdeteran
Como hago para que al presionar F1 no se despliege mensaje "No Help file defined with SetHelpFile()!"
Con FWH 2.7 no me pasaba esto.
Gracias
Re: Como inhibo F1
Posted: Wed Jan 06, 2010 10:50 am
by karinha
Code: Select all
//-----------------------------------------------------------------------//
// 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
// varanzan@gruposp.com
// 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"
Re: Como inhibo F1
Posted: Sun Sep 08, 2013 3:53 am
by cuatecatl82
Otra opcion más facil y sin agregar o modificar el archivo Help32.prg de Fivewin:
Agregar dentro de nuestro proyecto la función HelpIndex que es llamado en el Metodo __HelpTopic() de la Clase TWindow, ya que al presionar la tecla F1 es invocada desde aquí llamando a esta función:
Así podemos llamar de forma independiente a una acción o función con la tecla F1
Code: Select all
SETKEY( VK_F1, { || MSGInfo("Llamando a Ayuda","Mi Función") } )
Aclaro que eso solo para llamar a la ayuda de forma general, pues no detecta que control o o número de HelpId lo invoca...
Espero les ayude saludos...