home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso / 00202 / s / disk3 / vbapi.h_ / vbapi.bin
Text File  |  1993-04-28  |  40KB  |  1,062 lines

  1. //---------------------------------------------------------------------------
  2. // VBAPI.H
  3. //---------------------------------------------------------------------------
  4. // Copyright (c) 1991-1993, Microsoft Corp.  All Rights Reserved.
  5. //---------------------------------------------------------------------------
  6. // Include file for the Visual Basic Custom Control and DLL application
  7. // programming interface.
  8. //---------------------------------------------------------------------------
  9.  
  10. //---------------------------------------------------------------------------
  11. // Handle C++ and Pack structures on 1-byte boundaries
  12. //---------------------------------------------------------------------------
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16.  
  17. #ifndef RC_INVOKED
  18. #pragma pack(1)
  19. #endif    // ifndef RC_INVOKED
  20.  
  21.  
  22.  
  23. //---------------------------------------------------------------------------
  24. // Version constants
  25. //---------------------------------------------------------------------------
  26. #define VB100_VERSION    0x0100
  27. #define VB200_VERSION    0x0200
  28. #define VB300_VERSION    0x0300
  29. #define VB_VERSION    VB300_VERSION
  30.  
  31.  
  32. //---------------------------------------------------------------------------
  33. // General types and modifiers
  34. //---------------------------------------------------------------------------
  35. typedef   signed short    SHORT;        // s
  36. typedef unsigned short    USHORT;     // u
  37. typedef unsigned int    FSHORT;     // fs
  38. typedef   signed char    CHAR;        // ch
  39. typedef unsigned char    ENUM;        // enum
  40. typedef unsigned long    ULONG;        // ul
  41. typedef unsigned long    FLONG;        // fl
  42. typedef SHORT       FAR *LPSHORT;    // lps
  43. typedef USHORT       FAR *LPUSHORT;    // lpu
  44. typedef USHORT          IPROP;          // iprop
  45. typedef HANDLE        HFORMFILE;    // hformfile
  46. typedef USHORT        ERR;        // err
  47. typedef WORD        HPIC;        // hpic
  48. typedef HPIC       FAR *LPHPIC;     // lphpic
  49. typedef LPSTR        HSZ;        // hsz
  50. typedef LPVOID        HLSTR;        // hlstr
  51. typedef HLSTR       FAR *LPHLSTR;    // lphlstr
  52. typedef LPVOID        HAD;        // hAD - handle to Basic array desc.
  53. typedef LPVOID        HCTL;        // hctl
  54. typedef LONG (FAR PASCAL *PFNWP)(HWND hwnd, USHORT msg, USHORT wp, LONG lp);            // pfnwp
  55. typedef LONG (FAR PASCAL *PCTLPROC)(HCTL hctl, HWND hwnd, USHORT msg, USHORT wp, LONG lp);  // pctlproc
  56.  
  57.  
  58. //---------------------------------------------------------------------------
  59. // Language Variant structures
  60. //---------------------------------------------------------------------------
  61. typedef struct
  62.   {
  63.   LONG lo;
  64.   LONG hi;
  65.   } CURRENCY;
  66.  
  67. typedef union
  68.   {
  69.   SHORT    i2;
  70.   LONG       i4;
  71.   float    r4;
  72.   double   r8;
  73.   CURRENCY cy;
  74.   HLSTR    hlstr;
  75.   } VALUE;
  76.  
  77. typedef VALUE FAR *LPVAL;
  78.  
  79. // The size of Variant is needed when a Variant is passed by value or in a
  80. // structure (user-defined type).
  81. typedef struct
  82.   {
  83.   char v[16];
  84.   } VARIANT;
  85.  
  86. typedef VARIANT FAR *LPVAR;
  87.  
  88. // Variant type constants. these are the return value of GetVariantType.
  89. // these are also defined in Constant.Txt for return value of VarType()
  90. #define VT_EMPTY    0    // Empty
  91. #define VT_NULL     1    // Null
  92. #define VT_I2        2    // Integer
  93. #define VT_I4        3    // Long
  94. #define VT_R4        4    // Single
  95. #define VT_R8        5    // Double
  96. #define VT_CURRENCY 6    // Currency
  97. #define VT_DATE     7    // Date
  98. #define VT_STRING   8    // String
  99.  
  100.  
  101. //---------------------------------------------------------------------------
  102. // COLOR - a Windows RGB DWORD value.
  103. //---------------------------------------------------------------------------
  104. typedef unsigned long COLOR;
  105. typedef COLOR     FAR *LPCOLOR;          // lpcolor
  106.  
  107. #define COLOR_DEFBITON    0x80000000    // bit set -> Win SysColor, not RGB
  108.  
  109. // Get RGB value from a color.
  110. #define RGBCOLOR(clr) \
  111.   (((clr)&COLOR_DEFBITON)?(GetSysColor((int)((clr)&0xFFFF))):((clr)&0xFFFFFF))
  112.  
  113.  
  114. //---------------------------------------------------------------------------
  115. // Property data structure
  116. //---------------------------------------------------------------------------
  117. typedef struct tagDATASTRUCT
  118.   {
  119.   LONG     data;            // Data for Get/Set
  120.   USHORT cindex;        // Number of indecies
  121.   struct
  122.     {
  123.     USHORT datatype;        // Type of nth index (Currently always DT_SHORT)
  124.     LONG   data;        // Value of nth index
  125.     } index[1];         // Currently, only 1-dim arrays supported
  126.   } DATASTRUCT;
  127.  
  128. typedef DATASTRUCT FAR    *LPDATASTRUCT;    // pds
  129. typedef DATASTRUCT NEAR *NPDATASTRUCT;    // npds
  130.  
  131.  
  132. //---------------------------------------------------------------------------
  133. // VISUAL BASIC variable types
  134. //---------------------------------------------------------------------------
  135. #define ET_I2        1   // 16 bit signed integer scalar or array variable
  136. #define ET_I4        2   // 32 bit signed integer scalar or array variable
  137. #define ET_R4        3
  138. #define ET_R8        4   // 64 bit real scalar or array variable
  139. #define ET_CY        5   // 64 bit currency scalar or array variable
  140. #define ET_HLSTR    6   // string scalar or array variable
  141. #define ET_SD        6   // older, unpreferred equivalent to ET_HLSTR
  142. #define ET_FS        7   // fixed-length string variable
  143.  
  144.  
  145. //---------------------------------------------------------------------------
  146. // Control Property definitions and structures.
  147. //---------------------------------------------------------------------------
  148. #define PF_datatype        0x000000FFL
  149. #define PF_fPropArray        0x00000100L
  150. #define PF_fSetData        0x00000200L
  151. #define PF_fSetMsg        0x00000400L
  152. #define PF_fNoShow        0x00000800L
  153. #define PF_fNoRuntimeW        0x00001000L
  154. #define PF_fGetData        0x00002000L
  155. #define PF_fGetMsg        0x00004000L
  156. #define PF_fSetCheck        0x00008000L
  157. #define PF_fSaveData        0x00010000L
  158. #define PF_fSaveMsg        0x00020000L
  159. #define PF_fLoadDataOnly    0x20010000L
  160. #define PF_fLoadMsgOnly     0x20020000L
  161. #define PF_fGetHszMsg        0x00040000L
  162. #define PF_fUpdateOnEdit    0x00080000L
  163. #define PF_fEditable        0x00100000L
  164. #define PF_fPreHwnd        0x00200000L
  165. #define PF_fDefVal        0x00400000L
  166. #define PF_fNoInitDef        0x00800000L
  167. #define PF_fNoRuntimeR        0x02000000L
  168. #define PF_fNoMultiSelect   0x04000000L
  169.  
  170. typedef struct tagPROPINFO
  171.   {
  172.   PSTR    npszName;
  173.   FLONG    fl;            // PF_ flags
  174.   BYTE    offsetData;        // Offset into static structure
  175.   BYTE    infoData;        // 0 or _INFO value for bitfield
  176.   LONG    dataDefault;        // 0 or _INFO value for bitfield
  177.   PSTR    npszEnumList;        // For type == DT_ENUM, this is
  178.                 // a near ptr to a string containing
  179.                 // all the values to be displayed
  180.                 // in the popup enumeration listbox.
  181.                 // Each value is an sz, with an
  182.                 // empty sz indicated the end of list.
  183.   BYTE    enumMax;        // Maximum legal value for enum.
  184.   } PROPINFO;
  185.  
  186. typedef PROPINFO  FAR  * LPPROPINFO;
  187. typedef PROPINFO  NEAR * NPPROPINFO;
  188. typedef PROPINFO  NEAR *  PPROPINFO;
  189. typedef PPROPINFO FAR  * LPPROPLIST;
  190. typedef PPROPINFO NEAR * NPPROPLIST;
  191. typedef PPROPINFO NEAR *  PPROPLIST;
  192.  
  193.  
  194. //---------------------------------------------------------------------------
  195. // Values for PROP PF_datatype
  196. //---------------------------------------------------------------------------
  197. #define DT_HSZ          0x01
  198. #define DT_SHORT      0x02
  199. #define DT_LONG       0x03
  200. #define DT_BOOL       0x04
  201. #define DT_COLOR      0x05
  202. #define DT_ENUM       0x06
  203. #define DT_REAL       0x07
  204. #define DT_XPOS       0x08    // Scaled from float to long twips
  205. #define DT_XSIZE      0x09    //   _SIZE scales without origin
  206. #define DT_YPOS       0x0A    //   _POS subtracts origin
  207. #define DT_YSIZE      0x0B    // uses parent's scale properties
  208. #define DT_PICTURE    0x0C
  209. #define DT_HLSTR      0x0D
  210. #define DT_OBJECT     0x20
  211.  
  212.  
  213. //---------------------------------------------------------------------------
  214. // Control event definitions and structures.
  215. //---------------------------------------------------------------------------
  216. #define EF_fNoUnload    0x00000001L
  217.  
  218. typedef struct tagEVENTINFO
  219.   {
  220.   PSTR        npszName;    // event procedure name suffix
  221.   USHORT    cParms;     // number of parameters
  222.   USHORT    cwParms;    // # words of parameters
  223.   PWORD        npParmTypes;    // list of parameter types
  224.   PSTR        npszParmProf;    // event parameter profile string
  225.   FLONG        fl;        // EF_ flags
  226.   } EVENTINFO;
  227.  
  228. typedef EVENTINFO   NEAR * PEVENTINFO;
  229. typedef PEVENTINFO  NEAR * PPEVENTINFO;
  230. typedef EVENTINFO   NEAR * NPEVENTINFO;
  231. typedef EVENTINFO   FAR  * LPEVENTINFO;
  232. typedef NPEVENTINFO FAR  * LPEVENTLIST;
  233. typedef NPEVENTINFO NEAR * NPEVENTLIST;
  234.  
  235.  
  236. //---------------------------------------------------------------------------
  237. // Standard control event list
  238. //---------------------------------------------------------------------------
  239. #define IEVENT_STD_CLICK    0x0000
  240. #define IEVENT_STD_DBLCLICK    0x0001
  241. #define IEVENT_STD_DRAGDROP    0x0002
  242. #define IEVENT_STD_DRAGOVER    0x0003
  243. #define IEVENT_STD_GOTFOCUS    0x0004
  244. #define IEVENT_STD_KEYDOWN    0x0005
  245. #define IEVENT_STD_KEYPRESS    0x0006
  246. #define IEVENT_STD_KEYUP    0x0007
  247. #define IEVENT_STD_LOSTFOCUS    0x0008
  248. #define IEVENT_STD_MOUSEDOWN    0x0009
  249. #define IEVENT_STD_MOUSEMOVE    0x000A
  250. #define IEVENT_STD_MOUSEUP    0x000B
  251. #define IEVENT_STD_LINKERROR    0x000C
  252. #define IEVENT_STD_LINKOPEN     0x000D
  253. #define IEVENT_STD_LINKCLOSE    0x000E
  254. #define IEVENT_STD_LINKNOTIFY   0x000F
  255. #define IEVENT_STD_LINKCHANGE   0x0010
  256. #define IEVENT_STD_NONE     0x0FFF
  257. #define IEVENT_STD_LAST     0x0FFF
  258.  
  259. #define PEVENTINFO_STD_CLICK        ((PEVENTINFO)~IEVENT_STD_CLICK)
  260. #define PEVENTINFO_STD_DBLCLICK     ((PEVENTINFO)~IEVENT_STD_DBLCLICK)
  261. #define PEVENTINFO_STD_DRAGDROP     ((PEVENTINFO)~IEVENT_STD_DRAGDROP)
  262. #define PEVENTINFO_STD_DRAGOVER     ((PEVENTINFO)~IEVENT_STD_DRAGOVER)
  263. #define PEVENTINFO_STD_GOTFOCUS     ((PEVENTINFO)~IEVENT_STD_GOTFOCUS)
  264. #define PEVENTINFO_STD_KEYDOWN        ((PEVENTINFO)~IEVENT_STD_KEYDOWN)
  265. #define PEVENTINFO_STD_KEYPRESS     ((PEVENTINFO)~IEVENT_STD_KEYPRESS)
  266. #define PEVENTINFO_STD_KEYUP        ((PEVENTINFO)~IEVENT_STD_KEYUP)
  267. #define PEVENTINFO_STD_LOSTFOCUS    ((PEVENTINFO)~IEVENT_STD_LOSTFOCUS)
  268. #define PEVENTINFO_STD_MOUSEDOWN    ((PEVENTINFO)~IEVENT_STD_MOUSEDOWN)
  269. #define PEVENTINFO_STD_MOUSEMOVE    ((PEVENTINFO)~IEVENT_STD_MOUSEMOVE)
  270. #define PEVENTINFO_STD_MOUSEUP        ((PEVENTINFO)~IEVENT_STD_MOUSEUP)
  271. #define PEVENTINFO_STD_LINKERROR    ((PEVENTINFO)~IEVENT_STD_LINKERROR)
  272. #define PEVENTINFO_STD_LINKOPEN     ((PEVENTINFO)~IEVENT_STD_LINKOPEN)
  273. #define PEVENTINFO_STD_LINKCLOSE    ((PEVENTINFO)~IEVENT_STD_LINKCLOSE)
  274. #define PEVENTINFO_STD_LINKNOTIFY   ((PEVENTINFO)~IEVENT_STD_LINKNOTIFY)
  275. #define PEVENTINFO_STD_LINKCHANGE   ((PEVENTINFO)~IEVENT_STD_LINKCHANGE)
  276. #define PEVENTINFO_STD_NONE        ((PEVENTINFO)~IEVENT_STD_NONE)
  277. #define PEVENTINFO_STD_LAST        ((PEVENTINFO)~IEVENT_STD_LAST)
  278.  
  279.  
  280. //---------------------------------------------------------------------------
  281. // Standard control properties
  282. //---------------------------------------------------------------------------
  283. #define IPROP_STD_NAME            0x0000
  284. #define IPROP_STD_CTLNAME        IPROP_STD_NAME
  285. #define IPROP_STD_INDEX         0x0001
  286. #define IPROP_STD_HWND            0x0002
  287. #define IPROP_STD_BACKCOLOR        0x0003
  288. #define IPROP_STD_FORECOLOR        0x0004
  289. #define IPROP_STD_LEFT            0x0005
  290. #define IPROP_STD_TOP            0x0006
  291. #define IPROP_STD_WIDTH         0x0007
  292. #define IPROP_STD_HEIGHT        0x0008
  293. #define IPROP_STD_ENABLED        0x0009
  294. #define IPROP_STD_VISIBLE        0x000A
  295. #define IPROP_STD_MOUSEPOINTER        0x000B
  296. #define IPROP_STD_CAPTION        0x000C
  297. #define IPROP_STD_FONTNAME        0x000D
  298. #define IPROP_STD_FONTBOLD        0x000E
  299. #define IPROP_STD_FONTITALIC        0x000F
  300. #define IPROP_STD_FONTSTRIKE        0x0010
  301. #define IPROP_STD_FONTUNDER        0x0011
  302. #define IPROP_STD_FONTSIZE        0x0012
  303. #define IPROP_STD_TABINDEX        0x0013
  304. #define IPROP_STD_PARENT        0x0014
  305. #define IPROP_STD_DRAGMODE        0x0015
  306. #define IPROP_STD_DRAGICON        0x0016
  307. #define IPROP_STD_BORDERSTYLEOFF    0x0017
  308. #define IPROP_STD_TABSTOP        0x0018
  309. #define IPROP_STD_TAG            0x0019
  310. #define IPROP_STD_TEXT            0x001B
  311. #define IPROP_STD_BORDERSTYLEON     0x001C
  312. #define IPROP_STD_CLIPCONTROLS        0x001D
  313. #define IPROP_STD_NONE            0x001E
  314. #define IPROP_STD_HELPCONTEXTID     0x001F
  315. #define IPROP_STD_LINKMODE        0x0020
  316. #define IPROP_STD_LINKITEM        0x0021
  317. #define IPROP_STD_LINKTOPIC        0x0022
  318. #define IPROP_STD_LINKTIMEOUT        0x0023
  319. #define IPROP_STD_LEFTNORUN        0x0024
  320. #define IPROP_STD_TOPNORUN        0x0025
  321. #define IPROP_STD_ALIGN         0x0026
  322. #define IPROP_STD_IMEMODE        0x0027
  323. #define IPROP_STD_DATASOURCE        0x0028
  324. #define IPROP_STD_DATAFIELD        0x0029
  325. #define IPROP_STD_DATACHANGED        0x002A
  326. #define IPROP_STD_LAST            0x0FFF
  327.  
  328. #define PPROPINFO_STD_NAME        ((PPROPINFO)~IPROP_STD_NAME)
  329. #define PPROPINFO_STD_CTLNAME        ((PPROPINFO)~IPROP_STD_NAME)
  330. #define PPROPINFO_STD_INDEX        ((PPROPINFO)~IPROP_STD_INDEX)
  331. #define PPROPINFO_STD_HWND        ((PPROPINFO)~IPROP_STD_HWND)
  332. #define PPROPINFO_STD_BACKCOLOR     ((PPROPINFO)~IPROP_STD_BACKCOLOR)
  333. #define PPROPINFO_STD_FORECOLOR     ((PPROPINFO)~IPROP_STD_FORECOLOR)
  334. #define PPROPINFO_STD_LEFT        ((PPROPINFO)~IPROP_STD_LEFT)
  335. #define PPROPINFO_STD_TOP        ((PPROPINFO)~IPROP_STD_TOP)
  336. #define PPROPINFO_STD_WIDTH        ((PPROPINFO)~IPROP_STD_WIDTH)
  337. #define PPROPINFO_STD_HEIGHT        ((PPROPINFO)~IPROP_STD_HEIGHT)
  338. #define PPROPINFO_STD_ENABLED        ((PPROPINFO)~IPROP_STD_ENABLED)
  339. #define PPROPINFO_STD_VISIBLE        ((PPROPINFO)~IPROP_STD_VISIBLE)
  340. #define PPROPINFO_STD_MOUSEPOINTER  ((PPROPINFO)~IPROP_STD_MOUSEPOINTER)
  341. #define PPROPINFO_STD_CAPTION        ((PPROPINFO)~IPROP_STD_CAPTION)
  342. #define PPROPINFO_STD_FONTNAME        ((PPROPINFO)~IPROP_STD_FONTNAME)
  343. #define PPROPINFO_STD_FONTBOLD        ((PPROPINFO)~IPROP_STD_FONTBOLD)
  344. #define PPROPINFO_STD_FONTITALIC    ((PPROPINFO)~IPROP_STD_FONTITALIC)
  345. #define PPROPINFO_STD_FONTSTRIKE    ((PPROPINFO)~IPROP_STD_FONTSTRIKE)
  346. #define PPROPINFO_STD_FONTUNDER     ((PPROPINFO)~IPROP_STD_FONTUNDER)
  347. #define PPROPINFO_STD_FONTSIZE        ((PPROPINFO)~IPROP_STD_FONTSIZE)
  348. #define PPROPINFO_STD_TABINDEX        ((PPROPINFO)~IPROP_STD_TABINDEX)
  349. #define PPROPINFO_STD_PARENT        ((PPROPINFO)~IPROP_STD_PARENT)
  350. #define PPROPINFO_STD_DRAGMODE        ((PPROPINFO)~IPROP_STD_DRAGMODE)
  351. #define PPROPINFO_STD_DRAGICON        ((PPROPINFO)~IPROP_STD_DRAGICON)
  352. #define PPROPINFO_STD_BORDERSTYLEOFF ((PPROPINFO)~IPROP_STD_BORDERSTYLEOFF)
  353. #define PPROPINFO_STD_TABSTOP        ((PPROPINFO)~IPROP_STD_TABSTOP)
  354. #define PPROPINFO_STD_TAG        ((PPROPINFO)~IPROP_STD_TAG)
  355. #define PPROPINFO_STD_TEXT        ((PPROPINFO)~IPROP_STD_TEXT)
  356. #define PPROPINFO_STD_BORDERSTYLEON ((PPROPINFO)~IPROP_STD_BORDERSTYLEON)
  357. #define PPROPINFO_STD_CLIPCONTROLS  ((PPROPINFO)~IPROP_STD_CLIPCONTROLS)
  358. #define PPROPINFO_STD_NONE        ((PPROPINFO)~IPROP_STD_NONE)
  359. #define PPROPINFO_STD_HELPCONTEXTID ((PPROPINFO)~IPROP_STD_HELPCONTEXTID)
  360. #define PPROPINFO_STD_LINKMODE        ((PPROPINFO)~IPROP_STD_LINKMODE)
  361. #define PPROPINFO_STD_LINKITEM        ((PPROPINFO)~IPROP_STD_LINKITEM)
  362. #define PPROPINFO_STD_LINKTOPIC     ((PPROPINFO)~IPROP_STD_LINKTOPIC)
  363. #define PPROPINFO_STD_LINKTIMEOUT   ((PPROPINFO)~IPROP_STD_LINKTIMEOUT)
  364. #define PPROPINFO_STD_LEFTNORUN     ((PPROPINFO)~IPROP_STD_LEFTNORUN)
  365. #define PPROPINFO_STD_TOPNORUN        ((PPROPINFO)~IPROP_STD_TOPNORUN)
  366. #define PPROPINFO_STD_ALIGN        ((PPROPINFO)~IPROP_STD_ALIGN)
  367. #define PPROPINFO_STD_IMEMODE        ((PPROPINFO)~IPROP_STD_IMEMODE)
  368. #define PPROPINFO_STD_DATASOURCE    ((PPROPINFO)~IPROP_STD_DATASOURCE)
  369. #define PPROPINFO_STD_DATAFIELD     ((PPROPINFO)~IPROP_STD_DATAFIELD)
  370. #define PPROPINFO_STD_DATACHANGED   ((PPROPINFO)~IPROP_STD_DATACHANGED)
  371.  
  372. #define PPROPINFO_STD_LAST        ((PPROPINFO)~IPROP_STD_LAST)
  373.  
  374.  
  375. //---------------------------------------------------------------------------
  376. // Structure for VBM_DRAGOVER and VBM_DRAGDROP events
  377. //---------------------------------------------------------------------------
  378. typedef struct tagDRAGINFO
  379.   {
  380.   HCTL     hctl;
  381.   POINT  pt;
  382.   USHORT state;     // Enter, Over, Exit; only used for VBM_DRAGOVER
  383.   } DRAGINFO;
  384.  
  385. typedef DRAGINFO NEAR * NPDRAGINFO;
  386. typedef DRAGINFO FAR  * LPDRAGINFO;
  387.  
  388. #define DRAG_STATE_ENTER       0x00
  389. #define DRAG_STATE_EXIT        0x01
  390. #define DRAG_STATE_OVER        0x02
  391.  
  392.  
  393. //---------------------------------------------------------------------------
  394. // Control MODEL structure
  395. //---------------------------------------------------------------------------
  396. typedef struct tagMODEL
  397.   {
  398.   USHORT    usVersion;        // VB version used by control
  399.   FLONG        fl;            // Bitfield structure
  400.   PCTLPROC    pctlproc;        // The control proc.
  401.   FSHORT    fsClassStyle;        // Window class style
  402.   FLONG        flWndStyle;        // Default window style
  403.   USHORT    cbCtlExtra;        // # bytes alloc'd for HCTL structure
  404.   WORD        idBmpPalette;        // BITMAP id for tool palette
  405.   PSTR        npszDefCtlName;        // Default control name prefix
  406.   PSTR        npszClassName;        // Visual Basic class name
  407.   PSTR        npszParentClassName;    // Parent window class if subclassed
  408.   NPPROPLIST    npproplist;        // Property list
  409.   NPEVENTLIST    npeventlist;        // Event list
  410.   BYTE        nDefProp;        // Index of default property
  411.   BYTE        nDefEvent;        // Index of default event
  412.   BYTE        nValueProp;        // Index of control value property
  413.   USHORT        usCtlVersion;           // Identifies the current version of
  414.                                         // the custom control. The values
  415.                                         // 1 and 2 are reserved for custom
  416.                                         // controls created with VB 1.0 and
  417.                                         // VB 2.0.
  418.   } MODEL;
  419.  
  420. typedef MODEL FAR  *  LPMODEL;
  421.  
  422. #define MODEL_fArrows        0x00000001L
  423. #define MODEL_fFocusOk        0x00000002L
  424. #define MODEL_fMnemonic     0x00000004L
  425. #define MODEL_fChildrenOk   0x00000008L
  426. #define MODEL_fInitMsg        0x00000010L
  427. #define MODEL_fLoadMsg        0x00000020L
  428. #define MODEL_fDesInteract  0x00000040L
  429. #define MODEL_fInvisAtRun   0x00000080L
  430. #define MODEL_fGraphical    0x00000100L
  431.  
  432.  
  433. //---------------------------------------------------------------------------
  434. // MODELINFO structure
  435. //---------------------------------------------------------------------------
  436. typedef struct tagMODELINFO
  437.   {
  438.   USHORT    usVersion;        // VB version used by control
  439.   LPMODEL FAR  *lplpmodel;        // pointer to null-terminated
  440.   } MODELINFO;                //    list of LPMODELS
  441.  
  442. typedef MODELINFO FAR *LPMODELINFO;
  443.  
  444.  
  445. //---------------------------------------------------------------------------
  446. // Picture structure
  447. //---------------------------------------------------------------------------
  448. typedef struct tagPIC
  449.   {
  450.   BYTE picType;
  451.   union
  452.     {
  453.     struct
  454.       {
  455.       HBITMAP    hbitmap;        // Bitmap
  456.       HPALETTE    hpal;            // Accompanying palette
  457.       } bmp;
  458.     struct
  459.       {
  460.       HANDLE    hmeta;            // Metafile
  461.       int    xExt, yExt;        // Extent
  462.       } wmf;
  463.     struct
  464.       {
  465.       HICON    hicon;            // Icon
  466.       } icon;
  467.     } picData;
  468.   BYTE picReserved[4];
  469.   } PIC;
  470.  
  471. typedef PIC FAR *LPPIC;
  472.  
  473. #define PICTYPE_NONE        0
  474. #define PICTYPE_BITMAP        1
  475. #define PICTYPE_METAFILE    2
  476. #define PICTYPE_ICON        3
  477.  
  478. #define HPIC_INVALID        0xFFFF
  479. #define HPIC_NULL        0
  480.  
  481.  
  482. //---------------------------------------------------------------------------
  483. // Mode constants
  484. //---------------------------------------------------------------------------
  485. #define MODE_DESIGN    1
  486. #define MODE_RUN    2
  487. #define MODE_BREAK    3
  488.  
  489.  
  490. //---------------------------------------------------------------------------
  491. // Control flags for use with VBSetControlFlags
  492. //---------------------------------------------------------------------------
  493. #define CTLFLG_HASPALETTE          0x00000001L
  494. #define CTLFLG_USESPALETTE          0x00000002L
  495. #define CTLFLG_GRAPHICALOPAQUE          0x00000004L
  496. #define CTLFLG_GRAPHICALTRANSLUCENT   0x00000008L
  497. #define CTLFLG_DATACHANGED          0x00000010L
  498. #define CTLFLG_BOUNDDATASET          0x00000020L
  499.  
  500.  
  501. //---------------------------------------------------------------------------
  502. // Data xfer structure for VBM_LINKGETDATA or VBM_LINKSETDATA
  503. //---------------------------------------------------------------------------
  504. typedef struct tagVBLINKDATA
  505.   {
  506.   WORD     wReserved;
  507.   DWORD    cb;          // Size of data
  508.   HANDLE   hData;      // Handle to data
  509.   DWORD    dwReserved;
  510.   } VBLINKDATA;
  511.  
  512. typedef VBLINKDATA FAR *LPLINKDATA;
  513.  
  514.  
  515. //---------------------------------------------------------------------------
  516. // Link modes
  517. //---------------------------------------------------------------------------
  518. #define LINKMODENONE            0
  519. #define LINKMODEAUTO            1
  520. #define LINKMODEMANUAL            2
  521. #define LINKMODENOTIFY                  3
  522.  
  523. #define LINKMODESERVERPOKE        1
  524. #define LINKMODESERVERNOPOKE        2
  525.  
  526. #define VBDDEDATA VBLINKDATA
  527. #define LPDDEDATA LPLINKDATA
  528.  
  529.  
  530. //---------------------------------------------------------------------------
  531. // Misc DDE defines
  532. //---------------------------------------------------------------------------
  533. #define MAX_EXEC                        256
  534. #define MAXLINKITEMNAME                 256
  535.  
  536. #define ACCEPTSDATAFORMAT                1
  537. #define SUPPLIESDATAFORMAT               2
  538.  
  539. #define LINKSRCASK                       0
  540. #define LINKSRCTELL                      1
  541.  
  542. #define LINK_DATA_OK             0
  543. #define LINK_DATA_OOM             1
  544. #define LINK_DATA_FORMATBAD         2
  545. #define LINK_DATA_SETFAILED         3
  546.  
  547. #define errInitOnNonServerDesk   6  // Attempted to Initate on a channel that
  548.                     // had linkmode set to None.
  549. #define errAllServerChUsed       7  // The Server Channel array is filled.
  550. #define errDataSettingFailed     8  // The Set quality failed possible string
  551.                     // too long.
  552. #define errOutOfMemoryForLink    11
  553.  
  554. //---------------------------------------------------------------------------
  555. // Bound control interface
  556. //---------------------------------------------------------------------------
  557.  
  558. // values for the sAction parameter on VBM_DATA_GET messages.
  559.  
  560. #define DATA_FIELDVALUE      0
  561. #define DATA_FIELDNAME         1
  562. #define DATA_FIELDTYPE         2
  563. #define DATA_FIELDSIZE         3
  564. #define DATA_FIELDSCOUNT     4
  565. #define DATA_FIELDCHUNK      5
  566. #define DATA_FIELDPOSITION   6
  567. #define DATA_FIELDATTRIBUTES 7
  568.  
  569. #define DATA_BOF         16
  570. #define DATA_EOF         17
  571. #define DATA_BOOKMARK         18
  572. #define DATA_BOOKMARKABLE    19
  573. #define DATA_UPDATABLE         20
  574. #define DATA_RECORDCOUNT     21
  575. #define DATA_LASTMODIFIED    22
  576.  
  577. // sAction values during VBM_DATA_AVAILABLE messages
  578.  
  579. #define DATA_MOVEFIRST          64
  580. #define DATA_MOVENEXT          65
  581. #define DATA_MOVEPREV          66
  582. #define DATA_MOVELAST          67
  583. #define DATA_FINDFIRST          68
  584. #define DATA_FINDNEXT          69
  585. #define DATA_FINDPREV          70
  586. #define DATA_FINDLAST          71
  587. #define DATA_DELETE          72
  588. #define DATA_ADDNEW          73
  589. #define DATA_REFRESH          74
  590. #define DATA_ROLLBACK          76
  591. #define DATA_CLOSE          77
  592. #define DATA_DATAFIELDCHANGED 78
  593. #define DATA_SAVEDATA          79
  594. #define DATA_READDATA          80
  595. #define DATA_UPDATE          81
  596. #define DATA_UNLOAD          82
  597.  
  598.  
  599. // return types for VBM_DATA_GET with sAction = DATA_FIELDTYPE
  600.  
  601. #define DATA_VT_BOOL       1
  602. #define DATA_VT_VAR_BYTE   2
  603. #define DATA_VT_INTEGER    3
  604. #define DATA_VT_LONG       4
  605. #define DATA_VT_CURRENCY   5
  606. #define DATA_VT_SINGLE       6
  607. #define DATA_VT_DOUBLE       7
  608. #define DATA_VT_DATETIME   8
  609. #define DATA_VT_TEXT       10
  610. #define DATA_VT_BINARY       11
  611. #define DATA_VT_MEMO       12
  612.  
  613. // VBM_DATA_GET with sAction = DATA_BOOKMARK fill in ldata with one of these
  614.  
  615. #define     DATA_BOOKMARKFIRST      ((LONG)0x80000000L)
  616. #define     DATA_BOOKMARKPREV     -1L
  617. #define     DATA_BOOKMARKCURRENT  0L
  618. #define     DATA_BOOKMARKNEXT      1L
  619. #define     DATA_BOOKMARKLAST      ((LONG)0x7FFFFFFFL)
  620.  
  621.  
  622.  
  623. //
  624. #define DA_fNull    0x0001
  625. #define DA_fBOF     0x0002
  626. #define DA_fEOF     0x0004
  627.  
  628.  
  629. //---------------------------------------------------------------------------
  630. // DA structure used for conversations with the data control
  631. //---------------------------------------------------------------------------
  632. typedef struct
  633. {
  634.   USHORT  usVersion;          // VB version of structure filled in when
  635.                   // structure is created
  636.   SHORT   sAction;          // on VBM_DATA_GET/SET specifies what to get/set
  637.                   // on VBM_DATA_AVAILABLE/REQUEST tells why
  638.   HCTL      hctlData;          // the data control providing data
  639.   HCTL      hctlBound;          // the bound control receiving data
  640.   HSZ      hszDataField;       // the name of the field to get value of
  641.   SHORT   sDataFieldIndex;      // the field index used when FieldName is null
  642.   USHORT  usDataType;          // the property datatype to convert data to
  643.   HLSTR   hlstrBookMark;      // used when getting multirow data
  644.   FSHORT  fs;              // Bitfield structure
  645.   LONG      lData;          // the data
  646.   ULONG   ulChunkOffset;      // the offset to start at for GetChunk
  647.   ULONG   ulChunkNumBytes;      // the number of bytes for GetChunk/SetChunk
  648. } DATAACCESS, FAR * LPDATAACCESS;
  649.  
  650.  
  651.  
  652.  
  653. //---------------------------------------------------------------------------
  654. //---------------------------------------------------------------------------
  655. // The VISUAL BASIC API routines
  656. //---------------------------------------------------------------------------
  657. //---------------------------------------------------------------------------
  658. #define CONTROLDEREF(type, hctl)    ((P##type)(VBDerefControl(hctl)))
  659. #define VBAPI FAR PASCAL
  660.  
  661. //-----------------
  662. // General routines
  663. //-----------------
  664. USHORT    VBAPI VBGetMode(VOID);
  665. USHORT    VBAPI VBGetVersion(VOID);
  666.  
  667. //-------------------------
  668. // General control routines
  669. //-------------------------
  670. LPVOID    VBAPI VBDerefControl(HCTL hctl);
  671. LONG    VBAPI VBDefControlProc(HCTL hctl, HWND hwnd, USHORT msg, USHORT wp, LONG lp);
  672. BOOL    VBAPI VBRegisterModel(HANDLE hmod, LPMODEL lpmdl);
  673. HWND    VBAPI VBGetControlHwnd(HCTL hctl);
  674. HANDLE    VBAPI VBGetHInstance(VOID);
  675. LPMODEL VBAPI VBGetControlModel(HCTL hctl);
  676. LPSTR    VBAPI VBGetControlName(HCTL hctl, LPSTR lpszName);
  677. HCTL    VBAPI VBGetHwndControl(HWND hwnd);
  678. LONG    VBAPI VBSendControlMsg(HCTL hctl, USHORT msg, USHORT wp, LONG lp);
  679. LONG    VBAPI VBSuperControlProc(HCTL hctl, USHORT msg, USHORT wp, LONG lp);
  680. ERR    VBAPI VBRecreateControlHwnd(HCTL hctl);
  681. VOID    VBAPI VBDirtyForm(HCTL hctl);
  682. ERR    VBAPI VBSetErrorMessage(ERR err, LPSTR lpstr);
  683. VOID    VBAPI VBGetAppTitle(LPSTR lpstr, USHORT cbMax);
  684. int    VBAPI VBDialogBoxParam(HANDLE hinst, LPSTR pszTemplateName, FARPROC lpDialogFunc, LONG lp);
  685. ULONG    VBAPI VBSetControlFlags(HCTL hctl, ULONG mask, ULONG value);
  686. HCTL    VBAPI VBGetCapture(VOID);
  687. VOID    VBAPI VBSetCapture(HCTL hctl);
  688. VOID    VBAPI VBReleaseCapture(VOID);
  689. VOID    VBAPI VBMoveControl(HCTL hctl, LPRECT lprect, BOOL fRepaint);
  690. VOID    VBAPI VBGetControlRect(HCTL hctl, LPRECT lprect);
  691. VOID    VBAPI VBGetRectInContainer(HCTL hctl, LPRECT lprect);
  692. VOID    VBAPI VBGetClientRect(HCTL hctl, LPRECT lprect);
  693. VOID    VBAPI VBClientToScreen(HCTL hctl, LPPOINT lppt);
  694. VOID    VBAPI VBScreenToClient(HCTL hctl, LPPOINT lppt);
  695. BOOL    VBAPI VBIsControlVisible(HCTL hctl);
  696. BOOL    VBAPI VBIsControlEnabled(HCTL hctl);
  697. VOID    VBAPI VBInvalidateRect(HCTL hctl, LPRECT lprect, BOOL fEraseBkGnd);
  698. VOID    VBAPI VBUpdateControl(HCTL hctl);
  699.  
  700. HCTL    VBAPI VBGetControl(HCTL hctl, WORD gc);
  701. #define GC_FIRSTSIBLING       0x0000
  702. #define GC_LASTSIBLING          0x0001
  703. #define GC_NEXTSIBLING          0x0002
  704. #define GC_PREVSIBLING          0x0003
  705. #define GC_CHILD          0x0005
  706. #define GC_CONTAINER          0x1000
  707. #define GC_FORM           0x1001
  708. #define GC_FIRSTCONTROL       0x1002
  709. #define GC_NEXTCONTROL          0x1003
  710. #define GC_FIRSTSELECTED      0x1004
  711. #define GC_NEXTSELECTED       0x1005
  712.  
  713. VOID    VBAPI VBZOrder(HCTL hctl, WORD zorder);
  714. #define ZORDER_FRONT    0
  715. #define ZORDER_BACK    1
  716.  
  717. //--------------------------------------------
  718. // Management of dynamically allocated strings
  719. //--------------------------------------------
  720. HSZ    VBAPI VBCreateHsz(HANDLE seg, LPSTR lpszString);
  721. HSZ    VBAPI VBDestroyHsz(HSZ hsz);
  722. LPSTR    VBAPI VBDerefHsz(HSZ hsz);
  723. LPSTR    VBAPI VBLockHsz(HSZ hsz);
  724. VOID    VBAPI VBUnlockHsz(HSZ hsz);
  725.  
  726. //-------------------------------
  727. // Management of language strings
  728. //-------------------------------
  729. HLSTR    VBAPI VBCreateHlstr(LPVOID pb, USHORT cbLen);
  730. HLSTR    VBAPI VBCreateTempHlstr(LPVOID pb, USHORT cbLen);
  731. VOID    VBAPI VBDestroyHlstr(HLSTR hlstr);
  732. LPSTR    VBAPI VBDerefHlstr(HLSTR hlstr);
  733. LPSTR    VBAPI VBDerefHlstrLen(HLSTR hlstr, LPUSHORT lpcbLen);
  734. LPSTR    VBAPI VBDerefZeroTermHlstr(HLSTR hlstr);
  735. USHORT    VBAPI VBGetHlstr(HLSTR hlstr, LPVOID pb, USHORT cbLen);
  736. USHORT    VBAPI VBGetHlstrLen(HLSTR hlstr);
  737. ERR    VBAPI VBSetHlstr(LPHLSTR lphlstr, LPVOID pb, USHORT cbLen);
  738. ERR    VBAPI VBResizeHlstr(HLSTR hlstr, USHORT newCbLen);
  739.  
  740. //-----------------------------------------
  741. // Management of language Variant data type
  742. //-----------------------------------------
  743. ERR    VBAPI VBCoerceVariant(LPVAR lpVar, SHORT vtype, LPVOID lpData);
  744. SHORT    VBAPI VBGetVariantType(LPVAR lpVar);
  745. SHORT    VBAPI VBGetVariantValue(LPVAR lpVar, LPVAL lpVal);
  746. ERR    VBAPI VBSetVariantValue(LPVAR lpVar, SHORT vtype, LPVOID lpData);
  747.  
  748. //------------------------------
  749. // Management of language arrays
  750. //------------------------------
  751. LPVOID    VBAPI VBArrayElement(HAD hAD, SHORT cIndex, LPSHORT lpi);
  752. LONG    VBAPI VBArrayBounds(HAD hAD, SHORT index);
  753. #define AB_INVALIDINDEX   1              // hAD or index is bad
  754. #define LOBOUND(x)      ((SHORT)((x) & 0xFFFF))
  755. #define HIBOUND(x)      ((SHORT)((x) >> 16))
  756. USHORT    VBAPI VBArrayElemSize(HAD hAD);
  757. LPVOID    VBAPI VBArrayFirstElem(HAD hAD);
  758. SHORT    VBAPI VBArrayIndexCount(HAD hAD);
  759.  
  760. //------------------
  761. // VB Error routines
  762. //------------------
  763. VOID    VBAPI VBRuntimeError(ERR err);
  764.  
  765. //--------------------------------------------
  766. // Floating-point stack save/restore utilities
  767. //--------------------------------------------
  768. USHORT    VBAPI VBCbSaveFPState(LPVOID pb, USHORT cb);
  769. VOID    VBAPI VBRestoreFPState(LPVOID pb);
  770.  
  771. //------------------------------
  772. // Firing Basic event procedures
  773. //------------------------------
  774. ERR    VBAPI VBFireEvent(HCTL hctl, USHORT idEvent, LPVOID lpparams);
  775. #define EVENTNOTFIRED    (0x7FFF)
  776.  
  777. //------------------------
  778. // Control property access
  779. //------------------------
  780. ERR    VBAPI VBGetControlProperty(HCTL hctl, USHORT idProp, LPVOID pdata);
  781. ERR    VBAPI VBSetControlProperty(HCTL hctl, USHORT idProp, LONG data);
  782.  
  783. //-----------------------------
  784. // Picture management functions
  785. //-----------------------------
  786. HPIC    VBAPI VBAllocPic(LPPIC lppic);
  787. HPIC    VBAPI VBAllocPicEx(LPPIC lppic, USHORT usVersion);
  788. VOID    VBAPI VBFreePic(HPIC hpic);
  789. HPIC    VBAPI VBGetPic(HPIC hpic, LPPIC lppic);
  790. HPIC    VBAPI VBGetPicEx(HPIC hpic, LPPIC lppic, USHORT usVersion);
  791. ERR    VBAPI VBPicFromCF(LPHPIC lphpic, HANDLE hData, WORD wFormat);
  792. HPIC    VBAPI VBRefPic(HPIC hpic);
  793. VOID    VBAPI VBPaletteChanged(HCTL hctl);
  794. COLOR    VBAPI VBTranslateColor(HCTL hctl, COLOR clr);
  795.  
  796. //------------------
  797. // File IO functions
  798. //------------------
  799. ERR    VBAPI VBReadFormFile(HFORMFILE hformfile, LPVOID pb, WORD cb);
  800. ERR    VBAPI VBWriteFormFile(HFORMFILE hformfile, LPVOID pb, WORD cb);
  801. LONG    VBAPI VBSeekFormFile(HFORMFILE hformfile, LONG offset);
  802. LONG    VBAPI VBRelSeekFormFile(HFORMFILE hformfile, LONG offset);
  803. ERR    VBAPI VBReadBasicFile(USHORT usFileNo, LPVOID pb, WORD cb);
  804. ERR    VBAPI VBWriteBasicFile(USHORT usFileNo, LPVOID pb, WORD cb);
  805. LONG    VBAPI VBSeekBasicFile(USHORT usFileNo, LONG offset);
  806. LONG    VBAPI VBRelSeekBasicFile(USHORT usFileNo, LONG offset);
  807.  
  808. //---------------------
  809. // Conversion functions
  810. //---------------------
  811. LONG    VBAPI VBYPixelsToTwips(SHORT Pixels);
  812. LONG    VBAPI VBXPixelsToTwips(SHORT Pixels);
  813. SHORT    VBAPI VBYTwipsToPixels(LONG Twips);
  814. SHORT    VBAPI VBXTwipsToPixels(LONG Twips);
  815.  
  816. //-------------------------
  817. // Link Interface functions
  818. //-------------------------
  819. ERR    VBAPI VBLinkPostAdvise(HCTL hctl);
  820. BOOL    VBAPI VBPasteLinkOk(HANDLE FAR *phTriplet, HCTL hctl);
  821. VOID    VBAPI VBLinkMakeItemName(HCTL hctl, LPSTR lpszBuf);
  822.  
  823. //-------------------------
  824. // Bound Control Interface functions
  825. //-------------------------
  826. HCTL    VBAPI VBGetDataSourceControl(HCTL,BOOL FAR *);
  827.  
  828. //---------------
  829. // Misc functions
  830. //---------------
  831. SHORT    VBAPI VBFormat(SHORT vtype, LPVOID lpData, LPSTR lpszFmt, LPVOID pb, USHORT cb);
  832.  
  833. //------------------------
  834. // Exports from .VBX files
  835. //------------------------
  836. #ifndef NOCCEXPORTS
  837. BOOL FAR PASCAL _export VBINITCC(USHORT usVersion, BOOL fRuntime);
  838. VOID FAR PASCAL _export VBTERMCC(VOID);
  839. LPMODELINFO FAR PASCAL _export VBGetModelInfo(USHORT usVersion);
  840. #endif // !NOCCEXPORTS
  841.  
  842.  
  843.  
  844. //---------------------------------------------------------------------------
  845. //---------------------------------------------------------------------------
  846. // Visual Basic messages
  847. //---------------------------------------------------------------------------
  848. //---------------------------------------------------------------------------
  849. #define VBM__BASE        ( WM_USER + 0x0C00 )
  850.  
  851. // All properties have been loaded.  Must set MODEL_fLoadMsg to receive.
  852. #define VBM_CREATED        ( VBM__BASE + 0x00 )
  853.  
  854. // Form load is complete or dynamic control is fully loaded.  Must set
  855. // MODEL_fLoadMsg to receive.
  856. #define VBM_LOADED        ( VBM__BASE + 0x01 )
  857.  
  858. // Pre-hwnd properties are not yet loaded (no hwnd exists for control yet).
  859. // Must set MODEL_fInitMsg to receive.
  860. #define VBM_INITIALIZE        ( VBM__BASE + 0x02 )
  861.  
  862. // Get a property value.
  863. // [wp=iprop, lp=pdata], RetVal=ERR
  864. #define VBM_GETPROPERTY     ( VBM__BASE + 0x03 )
  865.  
  866. // Verify a property value.
  867. // [wp=iprop, lp=data], RetVal=ERR
  868. #define VBM_CHECKPROPERTY    ( VBM__BASE + 0x04 )
  869.  
  870. // Set a property value.
  871. // [wp=iprop, lp=data], RetVal=ERR
  872. #define VBM_SETPROPERTY     ( VBM__BASE + 0x05 )
  873.  
  874. // Write a property.
  875. // [wp=iprop, lp=pfileref], RetVal=ERR
  876. #define VBM_SAVEPROPERTY    ( VBM__BASE + 0x06 )
  877.  
  878. // Read a property.
  879. // [wp=iprop, lp=pfileref], RetVal=ERR
  880. #define VBM_LOADPROPERTY    ( VBM__BASE + 0x07 )
  881.  
  882. // Get the string representation of a property.
  883. // [wp=iprop, lp=HSZ FAR *], RetVal=ERR
  884. #define VBM_GETPROPERTYHSZ    ( VBM__BASE + 0x08 )
  885.  
  886. // Create popup window used to change a property.
  887. // [wp=iprop, lp=listbox hwnd], RetVal=popup hwnd
  888. #define VBM_INITPROPPOPUP    ( VBM__BASE + 0x09 )
  889.  
  890. // Determine if Paste/PasteLink is allowed.
  891. // [wp=PASTETYPE], RetVal=BOOL
  892. #define VBM_QPASTEOK        ( VBM__BASE + 0x0A )
  893.  
  894. #define PT_PASTE    0
  895. #define PT_PASTELINK    1
  896.  
  897. // Paste control-specific data from the clipboard.
  898. // [wp=PASTETYPE], RetVal=ERR
  899. #define VBM_PASTE        ( VBM__BASE + 0x0B )
  900.  
  901. // Copy control specific data to the clipboard.
  902. #define VBM_COPY        ( VBM__BASE + 0x0C )
  903.  
  904. // Control activated upon receipt of a unique mnemonic key.
  905. #define VBM_MNEMONIC        ( VBM__BASE + 0x0D )
  906.  
  907. // Posted to fire a deferred event.
  908. // [wp=event]
  909. #define VBM_FIREEVENT        ( VBM__BASE + 0x0E )
  910.  
  911. // Another control in drag mode drug over the control.
  912. // [lp=pdraginfo]
  913. #define VBM_DRAGOVER        ( VBM__BASE + 0x0F )
  914.  
  915. // This message is sent to a control that has just had another control
  916. // in drag mode dropped on it.
  917. // [lp=pdraginfo]
  918. #define VBM_DRAGDROP        ( VBM__BASE + 0x10 )
  919.  
  920. // This message is sent when certain methods are invoked on controls
  921. // [wp=METH_, lp=far *alParams], RetVal=ERR
  922. #define VBM_METHOD        ( VBM__BASE + 0x11 )
  923.  
  924. #define METH_ADDITEM    0x0001    // args are: cArgs, hszItem, [index]
  925. #define METH_REMOVEITEM 0x0002    // args are: cArgs, index
  926. #define METH_REFRESH    0x0003    // no args (lp == NULL)
  927. #define METH_MOVE    0x0004    // args are: cArgs, left, [top, [width, [height]]]
  928. #define METH_DRAG    0x0005    // args are: cArgs, [cmd]
  929. #define METH_LINKSEND   0x0006  // no args (lp == NULL)
  930. #define METH_ZORDER    0x0007    // args are: cArgs, pos
  931. #define METH_CLEAR    0x000A    // no args (lp == NULL)
  932.  
  933. // Clear capture and internal state.
  934. #define VBM_CANCELMODE        ( VBM__BASE + 0x12 )
  935.  
  936. // Paint notification for graphical controls.
  937. // [wp=hdc, lp=lprect]
  938. #define VBM_PAINT        ( VBM__BASE + 0x14 )
  939.  
  940. // Hit test for graphical controls.
  941. // [lp=lphittest], RetVal = HT_
  942. #define VBM_HITTEST        ( VBM__BASE + 0x15 )
  943.  
  944. #define HT_ON          7
  945. #define HT_SOLID_NEAR      6
  946. #define HT_PATTERN_NEAR   5
  947. #define HT_HOLLOW_NEAR      4
  948. #define HT_SOLID      3
  949. #define HT_PATTERN      2
  950. #define HT_HOLLOW      1
  951. #define HT_MISS       0
  952. typedef struct tagHITTEST
  953.   {
  954.   POINT pt;        // Point to test (in parent's coordinates)
  955.   RECT    rect;        // Rect of self (in parent's coordinates)
  956.   } HITTEST;
  957. typedef HITTEST FAR *LPHITTEST;
  958.  
  959. // Paint the multi-select handles
  960. // [wp=hdc, lp=rect(in hdc coords)]
  961. #define VBM_PAINTMULTISEL    ( VBM__BASE + 0x16 )
  962.  
  963. // Paint the "gray rect" or ctl outline while moving/sizing ctl.
  964. // [wp=hdc, lp=rect(in hdc coords)]
  965. #define VBM_PAINTOUTLINE    ( VBM__BASE + 0x17 )
  966.  
  967. // Palette change notification.
  968. // [wp=fPalBack(for SelectPalette)], RetVal = return from RealizePalette
  969. #define VBM_PALETTECHANGED    ( VBM__BASE + 0x1B )
  970.  
  971. // Get control palette.
  972. // RetVal = HPALETTE.
  973. #define VBM_GETPALETTE        ( VBM__BASE + 0x1C )
  974.  
  975. // Enumerate available formats.
  976. // [wp=SUPPLIESDATAFORMAT | ACCEPTSDATAFORMAT]
  977. // [LOWORD(lp)=ennumeration(0-x)]
  978. #define VBM_LINKENUMFORMATS    ( VBM__BASE + 0x1E )
  979.  
  980. // Ask a control for it's LINK item name.  Return item name as lpsz in lp.
  981. // [wp=LINKSRCASK | LINKSRCTELL]
  982. // [lp=lpszItemName]
  983. #define VBM_LINKGETITEMNAME    ( VBM__BASE + 0x1F )
  984.  
  985. // For Server items and client pokes.
  986. // [wp=wFormat lp=LPLINKDATA]
  987. #define VBM_LINKGETDATA     ( VBM__BASE + 0x20 )
  988.  
  989. // Used in client requests, advises, and server pokes.
  990. // [wp=wFormat lp=LPLINKDATA]
  991. #define VBM_LINKSETDATA     ( VBM__BASE + 0x21 )
  992.  
  993. // Get help on property or event name.
  994. // [LOBYTE(wp)=VBHELP_, HIBYTE(wp)=iprop/ievent, lp=lpmodel]
  995. #define VBM_HELP        ( VBM__BASE + 0x22 )
  996.  
  997. #define VBHELP_PROP    0x0001
  998. #define VBHELP_EVT    0x0002
  999. #define VBHELP_CTL        0x0003
  1000.  
  1001. // Get default size of control
  1002. // LOWORD(RetVal)=cx, HIWORD(RetVal)=cy
  1003. #define VBM_GETDEFSIZE        ( VBM__BASE + 0x23 )
  1004.  
  1005. // Just like VBM_SAVE(LOAD)PROPERTY, but saves (loads) as text.
  1006. #define VBM_SAVETEXTPROPERTY    ( VBM__BASE + 0x24 )
  1007. #define VBM_LOADTEXTPROPERTY    ( VBM__BASE + 0x25 )
  1008.  
  1009. // Is char a mnemonic for this control?
  1010. // [wp=char] RetVal=TRUE/FALSE
  1011. #define VBM_ISMNEMONIC        ( VBM__BASE + 0x26 )
  1012.  
  1013. // Does control want to see WM_KEYUP/WM_KEYDOWN for vk?  Sent only
  1014. // for keys which are normally trapped by VB.  E.g. Tab, Enter, etc.
  1015. // [wp=vk] RetVal=TRUE/FALSE
  1016. #define VBM_WANTSPECIALKEY    ( VBM__BASE + 0x27 )
  1017.  
  1018. //Notifies a control that it has been selected in the property window.
  1019. //[wp=multiselect ON (TRUE) or OFF (FALSE)]
  1020. //[LOWORD(lp)=multiselect count (0 first, n last)]
  1021. #define VBM_SELECTED        ( VBM__BASE + 0x28 )
  1022.  
  1023. // Bound control interface
  1024. #define VBM_DATA_INITIATE    (VBM__BASE + 0x29)
  1025. #define VBM_DATA_TERMINATE    (VBM__BASE + 0x2A)
  1026.  
  1027. #define VBM_DATA_AVAILABLE    (VBM__BASE + 0x2B)
  1028. #define VBM_DATA_GET        (VBM__BASE + 0x2C)
  1029. #define VBM_DATA_REQUEST    (VBM__BASE + 0x2D)
  1030. #define VBM_DATA_SET        (VBM__BASE + 0x2E)
  1031. #define VBM_DATA_METHOD     (VBM__BASE + 0x2F)
  1032.  
  1033.  
  1034. // Notifications reflected back to control from parent.
  1035. #define VBN__BASE        (VBM__BASE + 0x1000)
  1036.  
  1037. #define VBN_COMMAND        (VBN__BASE + WM_COMMAND)
  1038. #define VBN_CTLCOLOR        (VBN__BASE + WM_CTLCOLOR)
  1039. #define VBN_DRAWITEM        (VBN__BASE + WM_DRAWITEM)
  1040. #define VBN_MEASUREITEM     (VBN__BASE + WM_MEASUREITEM)
  1041. #define VBN_DELETEITEM        (VBN__BASE + WM_DELETEITEM)
  1042. #define VBN_VKEYTOITEM        (VBN__BASE + WM_VKEYTOITEM)
  1043. #define VBN_CHARTOITEM        (VBN__BASE + WM_CHARTOITEM)
  1044. #define VBN_COMPAREITEM     (VBN__BASE + WM_COMPAREITEM)
  1045. #define VBN_HSCROLL        (VBN__BASE + WM_HSCROLL)
  1046. #define VBN_VSCROLL        (VBN__BASE + WM_VSCROLL)
  1047. #define VBN_PARENTNOTIFY    (VBN__BASE + WM_PARENTNOTIFY)
  1048.  
  1049.  
  1050. //---------------------------------------------------------------------------
  1051. // END: Handle C++ and Pack structures on 1-byte boundaries
  1052. //---------------------------------------------------------------------------
  1053. #ifndef RC_INVOKED
  1054. #pragma pack()
  1055. #endif    // ifndef RC_INVOKED
  1056.  
  1057. #ifdef __cplusplus
  1058. }
  1059. #endif
  1060.  
  1061. //-- End Of File ------------------------------------------------------------
  1062.