ADD MY FUNCTION to F1 KEY ?

ADD MY FUNCTION to F1 KEY ?

Postby avista » Sun Oct 14, 2012 2: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,
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: ADD MY FUNCTION to F1 KEY ?

Postby Manuel Aranda » Sun Oct 14, 2012 5:36 pm

Debes enlazar help32.prg comentando la linea:

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


Code: Select all  Expand view

//-----------------------------------------------------------------------//
// 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
User avatar
Manuel Aranda
 
Posts: 604
Joined: Wed Oct 19, 2005 8:20 pm
Location: España

Re: ADD MY FUNCTION to F1 KEY ?

Postby Marc Vanzegbroeck » Sun Oct 14, 2012 8:23 pm

avista,

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

Code: Select all  Expand view
*if nKey == VK_F1
*   ::HelpTopic()
*   return 0
*endif
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: ADD MY FUNCTION to F1 KEY ?

Postby avista » Sun Oct 14, 2012 8:37 pm

Hi and thanks for reply
byt DONT WORK !

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


Any other solution ?

Regards
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: ADD MY FUNCTION to F1 KEY ?

Postby Marc Vanzegbroeck » Mon Oct 15, 2012 7: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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: ADD MY FUNCTION to F1 KEY ?

Postby avista » Wed Oct 17, 2012 9:21 am

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

Regards,
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: ADD MY FUNCTION to F1 KEY ?

Postby Marc Vanzegbroeck » 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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: ADD MY FUNCTION to F1 KEY ?

Postby avista » Thu Oct 18, 2012 9:25 am

User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 79 guests