home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / OS2BAS.ZIP / REGBAS.BI < prev    next >
Text File  |  1989-09-12  |  3KB  |  88 lines

  1. '**************************************************************
  2. '*
  3. '* Include File: RegBas.BI
  4. '*
  5. '* Requires:     none
  6. '*
  7. '* Description:  Support routines for BASIC PM programs
  8. '*
  9. '*************************************************************
  10.  
  11. ' MakeLong& is a function which takes two integers and returns long with each
  12. ' integer as the high and low word. This function is used to pass long
  13. ' addresses of data items to the PM routines. For example:
  14. '
  15. ' LongAddr& = MakeLong&(VARSEG(avar), VARPTR(avar))
  16.  
  17. DECLARE FUNCTION MakeLong&(BYVAL highword AS INTEGER, BYVAL lowword AS INTEGER)
  18.  
  19. ' BreakLong is a subroutine which takes a long and two integers.  The long
  20. ' will be broken into its high and lo bytes which are returned in the
  21. ' integers.  For example:
  22. '
  23. ' BreakLong(&H010002&, HiWord, LoWord)
  24. ' PRINT HiWord, LoWord
  25.  
  26. DECLARE SUB BreakLong(BYVAL along AS LONG, hiword AS INTEGER, loword AS INTEGER)
  27.  
  28. ' RegBas is a function which is necessary for the WinRegisterClass call.
  29. ' It returns the address of the function which calls ClientWndProc& in YOUR
  30. ' code.  You must use this address when registering the class. For example:
  31. '
  32. ' bool%=WinRegisterClass%(hab&,_
  33. '                         MakeLong(varseg(szClientClass$), sadd(szClientClass$)),_
  34. '                         RegBas&,_
  35. '                         CSSIZEREDRAW,_
  36. '                         0)
  37. '
  38. ' Your BASIC function must be defined as follows:
  39. '
  40. ' FUNCTION ClientWndProc&(hwnd&, msg%, mp1&, mp2&)
  41.  
  42.  
  43. DECLARE FUNCTION RegBas&
  44.  
  45. ' The RegBasN& functions are for registering multiple classes. You need to use
  46. ' a different function for each new class of window. Your BASIC function which
  47. ' will be called must be named ClientWndProcN&. For example,
  48. '
  49. '   RegBas1&  registers ClientWndProc1&
  50. '   RegBas2&  registers ClientWndProc2&
  51. '   RegBas3&  registers ClientWndProc3&
  52. '
  53. ' To use one of these functions, just take the comment off the DECLARE line.
  54.  
  55. 'DECLARE FUNCTION RegBas1&
  56. 'DECLARE FUNCTION RegBas2&
  57. 'DECLARE FUNCTION RegBas3&
  58. 'DECLARE FUNCTION RegBas4&
  59. 'DECLARE FUNCTION RegBas5&
  60. 'DECLARE FUNCTION RegBas6&
  61. 'DECLARE FUNCTION RegBas7&
  62. 'DECLARE FUNCTION RegBas8&
  63. 'DECLARE FUNCTION RegBas9&
  64. 'DECLARE FUNCTION RegBas10&
  65. 'DECLARE FUNCTION RegBas11&
  66. 'DECLARE FUNCTION RegBas12&
  67. 'DECLARE FUNCTION RegBas13&
  68. 'DECLARE FUNCTION RegBas14&
  69. 'DECLARE FUNCTION RegBas15&
  70. 'DECLARE FUNCTION RegBas16&
  71. 'DECLARE FUNCTION RegBas17&
  72. 'DECLARE FUNCTION RegBas18&
  73. 'DECLARE FUNCTION RegBas19&
  74. 'DECLARE FUNCTION RegBas20&
  75.  
  76. ' The RegxxxHook& functions are for registering various types of hooks. You
  77. ' need to use a different function for each new type of hook. Your BASIC
  78. ' function which will be called must be named xxxHook&.  For more information
  79. ' on using these functions, see Section III. Support Modules in the
  80. ' documentation.
  81. '
  82. ' To use one of these functions, just take the comment off the DECLARE line.
  83.  
  84. 'DECLARE FUNCTION RegInputHook&
  85. 'DECLARE FUNCTION RegSendMsgHook&
  86. 'DECLARE FUNCTION RegMsgFilterHook&
  87. 'DECLARE FUNCTION RegHelpHook&
  88.