FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ADD MY FUNCTION to F1 KEY ?
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
ADD MY FUNCTION to F1 KEY ?
Posted: Sun Oct 14, 2012 02:59 PM
Hi all

Is it possible to add my function to VK_F1
Somethink like: SetKey( VK_F1, { || MsgInfo("Hello") } )
I dont want mesage "No Help file defined with SetHelpFile()!"

Best regards,
Posts: 610
Joined: Wed Oct 19, 2005 08:20 PM
Re: ADD MY FUNCTION to F1 KEY ?
Posted: Sun Oct 14, 2012 05:36 PM
Debes enlazar help32.prg comentando la linea:

//MsgStop( "No Help file available", " Attention" )


Code (fw): Select all Collapse
//-----------------------------------------------------------------------//
// 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.
//-----------------------------------------------------------------------//
// 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( "No Help file available", " Attention" )
      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( "No Help file available", " Attention" )
      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( "No Help file available", " Attention" )
      return .f.
   endif

   SPWinHelpC( GetActiveWindow(), cHelpFile, HELP_PARTIALKEY, cSearch )

return NIL

//-----------------------------------------------------------------------//

function HelpPopup( nHelpId )

   local cHelpFile  := GetHelpFile()

   if Empty( cHelpFile )
      //MsgStop( "No Help file available", " Attention" )
      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"

#ifndef __CLIPPER__

DLL32 Function HTMLHelp( ;
   hWnd As LONG, cChmFile As LPSTR, nCommand As LONG, nTopic As LONG ) ;
   As LONG From "HtmlHelpA" Lib "hhctrl.ocx"

DLL32 Function HTMLHelpCtx( ;
   hWnd As LONG, cChmFile As LPSTR, nCommand As LONG, cTopic As LPSTR ) ;
   As LONG From "HtmlHelpA" Lib "hhctrl.ocx"

DLL32 Function HTMLHelpPopup( ;
   hWnd As LONG, cChmFile As LPSTR, nCommand As LONG, @sPopUp As LPSTR ) ;
   As LONG From "HtmlHelpA" Lib "hhctrl.ocx"

#endif
Un saludo,

Manuel



xH 1.2.3, FWH 23.07 32 bits, BC++ 7.4, xVerce CW 1.0, PellesC
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: ADD MY FUNCTION to F1 KEY ?
Posted: Sun Oct 14, 2012 08:23 PM
avista,

You have to comment these lines in keydown() methode of tWindows

Code (fw): Select all Collapse
*if nKey == VK_F1
*   ::HelpTopic()
*   return 0
*endif
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: ADD MY FUNCTION to F1 KEY ?
Posted: Sun Oct 14, 2012 08:37 PM
Hi and thanks for reply
byt DONT WORK !

Code (fw): Select all Collapse
*  if nKey == VK_F1
*     // ::HelpTopic()  // as WM_HELP is now supported by controls
*     return 0
*  endif


Any other solution ?

Regards
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: ADD MY FUNCTION to F1 KEY ?
Posted: Mon Oct 15, 2012 07:53 AM

Did you recompile it, and linked it before the fw-lib?

Sended with Tapatalk

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: ADD MY FUNCTION to F1 KEY ?
Posted: Wed Oct 17, 2012 09:21 AM

Marc,
I added window.prg in program, (compiled and linked)
But the same result

Regards,

Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: ADD MY FUNCTION to F1 KEY ?
Posted: Wed Oct 17, 2012 10:13 AM

Sorry, I don't know the solution.
I just tested it on my system, and have the same problem.
Maybe Antonio know the answer.

Sended with Tapatalk

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: ADD MY FUNCTION to F1 KEY ?
Posted: Thu Oct 18, 2012 09:25 AM

Continue the discussion