home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / inole2 / inc / gizmobar.h < prev    next >
C/C++ Source or Header  |  1995-05-03  |  5KB  |  181 lines

  1. /*
  2.  * GIZMOBAR.H
  3.  * GizmoBar portion of INOLE.DLL
  4.  *
  5.  * Public definitions for application that use the GizmoBar such as
  6.  * messages, prototypes for API functions, notification codes, and
  7.  * control styles.
  8.  *
  9.  * Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  10.  *
  11.  * Kraig Brockschmidt, Microsoft
  12.  * Internet  :  kraigb@microsoft.com
  13.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  14.  */
  15.  
  16.  
  17. #ifndef _GIZMOBAR_H_
  18. #define _GIZMOBAR_H_
  19.  
  20. #include <bttncur.h>
  21. #include <book1632.h>
  22.  
  23. #ifdef __cplusplus
  24. extern "C"
  25.     {
  26. #endif
  27.  
  28.  
  29. //Global classnames
  30. #define CLASS_GIZMOBAR  TEXT("gizmobar")
  31.  
  32.  
  33. //Message API Functions
  34. HWND    WINAPI GBHwndAssociateSet(HWND, HWND);
  35. HWND    WINAPI GBHwndAssociateGet(HWND);
  36.  
  37. BOOL    WINAPI GBGizmoAdd(HWND, UINT, UINT, UINT, UINT, UINT, LPTSTR
  38.             , HBITMAP, UINT, UINT);
  39. BOOL    WINAPI GBGizmoRemove(HWND, UINT);
  40.  
  41. LRESULT WINAPI GBGizmoSendMessage(HWND, UINT, UINT, WPARAM, LPARAM);
  42.  
  43. BOOL    WINAPI GBGizmoShow(HWND, UINT, BOOL);
  44. BOOL    WINAPI GBGizmoEnable(HWND, UINT, BOOL);
  45. BOOL    WINAPI GBGizmoCheck(HWND, UINT, BOOL);
  46. UINT    WINAPI GBGizmoFocusSet(HWND, UINT);
  47. BOOL    WINAPI GBGizmoExist(HWND, UINT);
  48.  
  49. int     WINAPI GBGizmoTypeGet(HWND, UINT);
  50.  
  51. DWORD   WINAPI GBGizmoDataSet(HWND, UINT, DWORD);
  52. DWORD   WINAPI GBGizmoDataGet(HWND, UINT);
  53. BOOL    WINAPI GBGizmoNotifySet(HWND, UINT, BOOL);
  54. BOOL    WINAPI GBGizmoNotifyGet(HWND, UINT);
  55.  
  56. int     WINAPI GBGizmoTextGet(HWND, UINT, LPTSTR, UINT);
  57. void    WINAPI GBGizmoTextSet(HWND, UINT, LPTSTR);
  58. UINT    WINAPI GBGizmoIntGet(HWND, UINT, BOOL FAR *, BOOL);
  59. void    WINAPI GBGizmoIntSet(HWND, UINT, UINT, BOOL);
  60.  
  61.  
  62.  
  63. //Notification codes sent via WM_COMMAND from GBHwndAssociateSet
  64. #define GBN_ASSOCIATEGAIN               1
  65. #define GBN_ASSOCIATELOSS               2
  66. #define GBN_GIZMOADDED                  3
  67. #define GBN_GIZMOREMOVED                4
  68.  
  69. //Message equivalents for functions.
  70. #define GBM_HWNDASSOCIATESET            (WM_USER+0)
  71. #define GBM_HWNDASSOCIATEGET            (WM_USER+1)
  72. #define GBM_GIZMOADD                    (WM_USER+2)
  73. #define GBM_GIZMOREMOVE                 (WM_USER+3)
  74. #define GBM_GIZMOSENDMESSAGE            (WM_USER+4)
  75. #define GBM_GIZMOSHOW                   (WM_USER+5)
  76. #define GBM_GIZMOENABLE                 (WM_USER+6)
  77. #define GBM_GIZMOCHECK                  (WM_USER+7)
  78. #define GBM_GIZMOFOCUSSET               (WM_USER+8)
  79. #define GBM_GIZMOEXIST                  (WM_USER+9)
  80. #define GBM_GIZMOTYPEGET                (WM_USER+10)
  81. #define GBM_GIZMODATASET                (WM_USER+11)
  82. #define GBM_GIZMODATAGET                (WM_USER+12)
  83. #define GBM_GIZMONOTIFYSET              (WM_USER+13)
  84. #define GBM_GIZMONOTIFYGET              (WM_USER+14)
  85. #define GBM_GIZMOTEXTGET                (WM_USER+15)
  86. #define GBM_GIZMOTEXTSET                (WM_USER+16)
  87. #define GBM_GIZMOINTGET                 (WM_USER+17)
  88. #define GBM_GIZMOINTSET                 (WM_USER+18)
  89.  
  90.  
  91.  
  92.  
  93. /*
  94.  * Structure passed in lParam of GBM_GIZMOADD that mirrors the
  95.  * parameters to GBGizmoAdd.
  96.  */
  97.  
  98. typedef struct
  99.     {
  100.     HWND        hWndParent;         //Parent window
  101.     UINT        iType;              //Type of gizmo
  102.     UINT        iGizmo;             //Position to create gizmo
  103.     UINT        uID;                //Identifier of gizmo
  104.     UINT        dx;                 //Dimensions of gizmo
  105.     UINT        dy;
  106.     LPTSTR      pszText;            //Gizmo text
  107.     HBITMAP     hBmp;               //Source of gizmo button image.
  108.     UINT        iImage;             //Index of image from hBmp
  109.     UINT        uState;             //Initial state of the gizmo.
  110.     } CREATEGIZMO, FAR *LPCREATEGIZMO;
  111.  
  112. #define CBCREATEGIZMO sizeof(CREATEGIZMO)
  113.  
  114.  
  115. //For GBM_GIZMOSENDMESSAGE
  116. typedef struct
  117.     {
  118.     UINT        iMsg;
  119.     WPARAM      wParam;
  120.     LPARAM      lParam;
  121.     } GBMSG, FAR * LPGBMSG;
  122.  
  123. #define CBGBMSG sizeof(GBMSG);
  124.  
  125. //For GBM_GIZMOGETTEXT
  126. typedef struct
  127.     {
  128.     LPTSTR      psz;
  129.     UINT        cch;
  130.     } GBGETTEXT, FAR * LPGBGETTEXT;
  131.  
  132. #define CBGBGETTEXT sizeof(GBGETTEXT);
  133.  
  134.  
  135. //For GBM_GIZMOGETINT
  136. typedef struct
  137.     {
  138.     BOOL        fSigned;
  139.     BOOL        fSuccess;
  140.     } GBGETINT, FAR * LPGBGETINT;
  141.  
  142. #define CBGBGETINT sizeof(GBGETINT);
  143.  
  144.  
  145. //For GBM_GIZMOSETINT
  146. typedef struct
  147.     {
  148.     UINT        uValue;
  149.     BOOL        fSigned;
  150.     } GBSETINT, FAR * LPGBSETINT;
  151.  
  152. #define CBGBSETINT sizeof(GBSETINT);
  153.  
  154.  
  155.  
  156. //Gizmo control types.  DO NOT CHANGE THESE!
  157. #define GIZMOTYPE_EDIT                  0x0001
  158. #define GIZMOTYPE_LISTBOX               0x0002
  159. #define GIZMOTYPE_COMBOBOX              0x0004
  160. #define GIZMOTYPE_BUTTONNORMAL          0x0008
  161. #define GIZMOTYPE_TEXT                  0x0010
  162. #define GIZMOTYPE_SEPARATOR             0x0020
  163. #define GIZMOTYPE_BUTTONATTRIBUTEIN     0x0040
  164. #define GIZMOTYPE_BUTTONATTRIBUTEEX     0x0080
  165. #define GIZMOTYPE_BUTTONCOMMAND         0x0100
  166.  
  167.  
  168. //Generic state flags for non-buttons based on BTTNCUR.H's groups.
  169. #define GIZMO_NORMAL                    (BUTTONGROUP_ACTIVE)
  170. #define GIZMO_DISABLED                  (BUTTONGROUP_DISABLED)
  171.  
  172.  
  173.  
  174. #ifdef __cplusplus
  175.     }   //Match with extern "C" above.
  176. #endif
  177.  
  178.  
  179.  
  180. #endif //_GIZMOBAR_H_
  181.