home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Multimedia Jumpstart 1.1a / CD_ROM.BIN / develpmt / source / hotspot / vbx / avivbx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-29  |  8.0 KB  |  253 lines

  1. // avivbx.h --
  2.  
  3. #ifndef VB_VERSION
  4.  #include <vbapi.h>
  5. #endif 
  6.  
  7. extern PCTLINFO pCtlInfoList;
  8.  
  9. // this could also have been named avihotCtl...
  10. #define pCtlInfoDEREF(hctl)     ((PCTLINFO)VBDerefControl(hctl))
  11.  
  12. //---------------------------------------------------------------------------
  13. // Resource Information
  14. //---------------------------------------------------------------------------
  15. // Toolbox bitmap resource IDs numbers.
  16. //---------------------------------------------------------------------------
  17. #define IDBMP_AVI            8000
  18. #define IDBMP_AVIDOWN        8001
  19. #define IDBMP_AVIMONO        8003
  20. #define IDBMP_AVIEGA         8006
  21.  
  22.  
  23. //---------------------------------------------------------------------------
  24. // Change these for each new VBX file
  25. //---------------------------------------------------------------------------
  26. #define VBX_COMPANYNAME        "Microsoft Corporation\0"
  27. #define VBX_FILEDESCRIPTION    "Visual Basic AVI Hotspot Custom Control\0"
  28. #define VBX_INTERNALNAME       "AVIHOT\0"
  29. #define VBX_LEGALCOPYRIGHT     "Copyright \251 Microsoft Corp. 1993\0"
  30. #define VBX_LEGALTRADEMARKS    "Microsoft\256 is a registered trademark of Microsoft Corporation. Visual Basic\231 is a trademark of Microsoft Corporation. Windows\231 is a trademark of Microsoft Corporation.\0"
  31. #define VBX_ORIGINALFILENAME       "AVIHOT.VBX\0"
  32. #define VBX_PRODUCTNAME        "Microsoft\256 Visual Basic\231 for Windows\231\0"
  33.  
  34. //---------------------------------------------------------------------------
  35. // Update these fields for each build.
  36. //---------------------------------------------------------------------------
  37. #define VBX_VERSION         3,00,0,00
  38. #define VBX_VERSION_STR        "3.00.000\0"
  39.  
  40.  
  41. #ifndef RC_INVOKED  
  42.  
  43. //---------------------------------------------------------------------------
  44. // Macro for referencing member of structure
  45. //---------------------------------------------------------------------------
  46. #define OFFSETIN(struc, field)      ((USHORT)&(((struc *)0)->field))
  47.  
  48. //---------------------------------------------------------------------------
  49. // Control Procedure
  50. //---------------------------------------------------------------------------
  51. LONG FAR PASCAL _export AVICtlProc(HCTL, HWND, USHORT, USHORT, LONG);
  52.  
  53.  
  54. //---------------------------------------------------------------------------
  55. // Property list
  56. //---------------------------------------------------------------------------
  57. // Define the consecutive indicies for the properties
  58. //---------------------------------------------------------------------------
  59. #define IPROP_AVI_CTLNAME              0
  60. #define IPROP_AVI_INDEX                1
  61. #define IPROP_AVI_BACKCOLOR            2
  62. #define IPROP_AVI_LEFT                 3
  63. #define IPROP_AVI_TOP                  4
  64. #define IPROP_AVI_WIDTH                5
  65. #define IPROP_AVI_HEIGHT               6
  66. #define IPROP_AVI_VISIBLE              7
  67. #define IPROP_AVI_PARENT               8
  68. #define IPROP_AVI_DRAGMODE             9
  69. #define IPROP_AVI_DRAGICON            10
  70. #define IPROP_AVI_TAG                 11
  71. #define IPROP_AVI_HWND                12
  72.  
  73. #define IPROP_AVI_LASTSTD             13
  74.  
  75. #define IPROP_AVI_AVIFILE             IPROP_AVI_LASTSTD + 0
  76. #define IPROP_AVI_HOTFILE             IPROP_AVI_LASTSTD + 1
  77. #define IPROP_AVI_PLAY                IPROP_AVI_LASTSTD + 2
  78. #define IPROP_AVI_FRAME               IPROP_AVI_LASTSTD + 3
  79. #define IPROP_AVI_LENGTH              IPROP_AVI_LASTSTD + 4
  80. #define IPROP_AVI_SHOWHOT             IPROP_AVI_LASTSTD + 5
  81.  
  82. PROPINFO Property_Play =
  83. {
  84.     "Play",
  85.     DT_SHORT | PF_fNoShow | PF_fSetMsg | PF_fSetData | PF_fGetData,
  86.     OFFSETIN(CTLINFO, fPlay),
  87.     0, 0, NULL, 0    
  88. };
  89.  
  90. PROPINFO Property_Length =
  91. {
  92.     "Length",
  93.     DT_LONG | PF_fSetData | PF_fSetMsg | PF_fGetData,
  94.     OFFSETIN(CTLINFO, lLength),
  95.     0, 0, NULL, 0    
  96. };
  97.  
  98.  
  99. PROPINFO Property_Frame =
  100. {
  101.     "Frame",
  102.     DT_LONG | PF_fSetMsg | PF_fSetData | PF_fGetData,
  103.     OFFSETIN(CTLINFO, lFrame),
  104.     0, 0, NULL, 0    
  105. };
  106.  
  107. PROPINFO Property_ShowHot =
  108. {
  109.     "ShowHot",
  110.     DT_ENUM | PF_fSetMsg | PF_fSetData | PF_fGetData,
  111.     OFFSETIN(CTLINFO, nShowHot),
  112.     0, 0, "0 - Invisible\0" "1 - Visible", 1    
  113. };
  114.  
  115. PROPINFO Property_AVIFile = 
  116. {
  117.     "AVIFile",
  118.     DT_HSZ | PF_fGetData | PF_fSetData | PF_fSetMsg | PF_fSaveData,
  119.     OFFSETIN(CTLINFO, hszAVIFile),
  120.     0, 0, NULL, 0
  121. };
  122.  
  123. PROPINFO Property_HOTFile = 
  124. {
  125.     "HOTFile",
  126.     DT_HSZ | PF_fGetData | PF_fSetData | PF_fSetMsg | PF_fSaveData,
  127.     OFFSETIN(CTLINFO, hszHotFile),
  128.     0, 0, NULL, 0
  129. };
  130.  
  131. PPROPINFO AVI_Properties[] =
  132.     {
  133.     PPROPINFO_STD_CTLNAME,
  134.     PPROPINFO_STD_INDEX,
  135.     PPROPINFO_STD_BACKCOLOR,
  136.     PPROPINFO_STD_LEFT,
  137.     PPROPINFO_STD_TOP,
  138.     PPROPINFO_STD_WIDTH,
  139.     PPROPINFO_STD_HEIGHT,
  140.     PPROPINFO_STD_VISIBLE,
  141.     PPROPINFO_STD_PARENT,
  142.     PPROPINFO_STD_DRAGMODE,
  143.     PPROPINFO_STD_DRAGICON,
  144.     PPROPINFO_STD_TAG,
  145.     PPROPINFO_STD_HWND,
  146.     &Property_AVIFile,
  147.     &Property_HOTFile,
  148.     &Property_Play,
  149.     &Property_Frame,
  150.     &Property_Length,
  151.     &Property_ShowHot,
  152.     NULL
  153.     };
  154.  
  155. //---------------------------------------------------------------------------
  156. // Event list
  157. //---------------------------------------------------------------------------
  158. // Define the consecutive indicies for the events
  159. //---------------------------------------------------------------------------
  160. #define IEVENT_AVI_HSPCLICK            0
  161. #define PLACE_HOLDER                   1
  162. #define IEVENT_AVI_DRAGDROP            2
  163. #define IEVENT_AVI_DRAGOVER            3
  164. #define IEVENT_AVI_SIZEADJUST          4
  165. #define IEVENT_AVI_AVIDONE               5
  166.  
  167. typedef struct tagHSPCLICKPARAMS
  168. {
  169.     HLSTR hlszHotspotID;          // appear in reverse order
  170.     LPVOID Index;
  171. } HSPCLICKPARAMS;
  172.  
  173. typedef struct tagSIZEADJUSTPARAMS
  174. {
  175.     int far *CX;           // must be a far ptr to data
  176.     int far *CY;
  177.     LPVOID Index;
  178. } SIZEADJUSTPARAMS;
  179.  
  180. typedef struct tagAVIDONEPARAMS
  181. {
  182.     LPVOID Index;
  183. } AVIDONEPARAMS;
  184.  
  185. WORD Paramtypes_HspClick[] = {ET_HLSTR};
  186. WORD Paramtypes_SizeAdjust[] = {ET_I2, ET_I2};
  187.  
  188. EVENTINFO Event_SizeAdjust =
  189.     {
  190.     "SizeAdjust",
  191.     2,
  192.     4,      // always twice the number in the second field
  193.     Paramtypes_SizeAdjust,
  194.     "CX As Single, CY As Single"        // width & height
  195.     };
  196.  
  197. EVENTINFO Event_HspClick =
  198.     {
  199.     "HotspotClick",
  200.     1,
  201.     2,      // always twice the number in the second field
  202.     Paramtypes_HspClick,
  203.     "HotspotID As String"
  204.     };
  205.  
  206. EVENTINFO Event_AviDone =
  207.     {
  208.     "AVIDone",
  209.     0,
  210.     0,      // always twice the number in the second field
  211.     Paramtypes_HspClick,
  212.     ""
  213.     };
  214.  
  215. PEVENTINFO AVI_Events[] =
  216.     {
  217.     &Event_HspClick,
  218.     PEVENTINFO_STD_NONE,    
  219.     PEVENTINFO_STD_DRAGDROP,
  220.     PEVENTINFO_STD_DRAGOVER,
  221.     &Event_SizeAdjust,
  222.     &Event_AviDone,
  223.     NULL
  224.     };
  225.  
  226. //---------------------------------------------------------------------------
  227. // Model struct
  228. //---------------------------------------------------------------------------
  229. // Define the control model (using the event and property structures).
  230. //---------------------------------------------------------------------------
  231. MODEL modelAvihot =
  232.     {
  233.     VB_VERSION,             // VB version being used
  234.     MODEL_fInitMsg | MODEL_fLoadMsg,                  // MODEL flags
  235.     (PCTLPROC)AVICtlProc,   // Control procedure
  236.     CS_VREDRAW | CS_HREDRAW,// Class style
  237.     WS_BORDER,              // Default Windows style
  238.     sizeof(CTLINFO),        // for passing info from VB to VBX
  239.     IDBMP_AVI,              // Palette bitmap ID
  240.     "AVIHOT",               // Default control name
  241.     "AVIHOT",               // Visual Basic class name
  242.     NULL,                   // Parent class name
  243.     AVI_Properties,         // Property information table
  244.     AVI_Events,             // Event information table
  245.     IPROP_AVI_BACKCOLOR,    // Default property
  246.     IEVENT_AVI_HSPCLICK,    // Default event
  247.     -1                      // Property representing value of ctl
  248.     };
  249.  
  250. #endif  // RC_INVOKED
  251.  
  252. //---------------------------------------------------------------------------
  253.