home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / help_key / hlpkey.txt < prev   
Text File  |  1992-09-22  |  1KB  |  40 lines

  1. -------------------------------------
  2. Info on HLPKEY.DLL
  3.  
  4. Author: Jeff Simms - CIS 72200,3173    
  5.  
  6. Date: September 21,1992
  7. -------------------------------------
  8.  
  9. DLL sets task specific F1 hook. When F1 is pressed a Keypress 
  10. event is trigger in the form of choice with Keyascii equal to 112.
  11. Eliminates need for separate F1 help KeyPress events.
  12.  
  13. To try demo: Put HLPKEY.DLL in your Windows system directory. 
  14.  
  15. Declares:
  16.  
  17. Declare Function SetHook% Lib "hlpkey.dll" (ByVal hWnd As Integer)
  18. 'In Form_Load you can put i% = SetHook(hWnd)
  19.  
  20. Declare Sub RemoveHook Lib "hlpkey.dll" ()
  21. 'In Form_Unload you can put RemoveHook 'no parens
  22.  
  23. Notes:
  24.  
  25. 1) You must call RemoveHook if you want to call SetHook again. 
  26.  
  27. 2) You may use just one form with the F1 KeyPress event code. In other words
  28.    its keypress event will be triggered (must be loaded of course) even if 
  29.    another form in the same project has the input focus when the user presses F1. 
  30.    This is the idea of a task specific hook.
  31.  
  32. Note on source code:
  33. Due to a 'mistake' in SetWindowsHookEx() the third param needs to
  34. be the module handle and not the instance handle as shown in docs.
  35.  
  36. If you have any questions let me know.
  37. DLL is FreeWare.
  38.  
  39. Jeff Simms
  40. CIS 72200,3173