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