home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / dbmsg / odbc / admndemo / menu.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-06  |  3.9 KB  |  134 lines

  1. //*---------------------------------------------------------------------------------
  2. //|  ODBC System Administrator
  3. //|
  4. //|  This code is furnished on an as-is basis as part of the ODBC SDK and is
  5. //|  intended for example purposes only.
  6. //|
  7. //|   Title:   MENU.H
  8. //|      This file contains our menu ids.
  9. //*---------------------------------------------------------------------------------
  10. #ifndef menu_DEFS
  11. #define menu_DEFS
  12.  
  13. #include <Windows.h>
  14.  
  15. //
  16. // Following are indexes into the menu table
  17. //
  18. enum {
  19.    MENU_SQLTABLES,
  20.    MENU_SQLCOLUMNS,
  21.    MENU_SQLSTATISTICS,
  22.    MENU_SQLPRIMARYKEYS,
  23.    MENU_SQLFOREIGNKEYS,
  24.    MENU_SQLTABLEPRIVILEGES,
  25.    MENU_SQLCOLUMNPRIVILEGES,
  26.    MENU_SQLSPECIALCOLUMNS,
  27.    MENU_SQLPROCEDURES,
  28.    MENU_SQLPROCEDURECOLUMNS,
  29.    MENU_SQLTRANSACT
  30.    };
  31.  
  32. #define NUM_MENU_FLAGS     MENU_SQLTRANSACT
  33.  
  34.  
  35. #define  IDM_WINDOW_POS      6
  36. #define  IDM_FIRSTCHILD       200
  37.  
  38. #define  IDM_FILE_MENU        0
  39. #define  IDM_CONNECT          100
  40. #define  IDM_DISCONNECT       101
  41. #define  IDM_EXECUTE_FILE     102
  42. #define  IDM_OPEN             103
  43. #define  IDM_CLOSE            104
  44. #define  IDM_SAVE             105
  45. #define  IDM_SAVEAS           106
  46. #define  IDM_EXIT             107
  47.  
  48. #define  IDM_EDIT_MENU        1
  49. #define  IDM_UNDO             108
  50. #define  IDM_CUT              109
  51. #define  IDM_COPY             110
  52. #define  IDM_PASTE            111
  53. #define  IDM_SELECT_ALL       112
  54.  
  55. #define  IDM_EXECUTE_MENU     2
  56. #define  IDM_EXECUTE_NOW      113
  57. #define  IDM_COMMIT           115
  58. #define  IDM_ROLLBACK         116
  59.  
  60. #define  IDM_PIPE_MENU        3
  61. #define  IDM_PIPE_EDIT        120
  62. #define  IDM_PIPE_DO          121
  63.  
  64. #define  IDM_INFO_MENU        4
  65. #define  IDM_MANAGE_DSNS      125
  66. #define  IDM_DATA_SOURCES     126
  67. #define  IDM_DATA_TYPES       127
  68. #define  IDM_FUNCTIONS        128
  69. #define  IDM_ODBC_INFO        129
  70.  
  71. #define  IDM_LIST_MENU        5
  72. #define  IDM_TABLES           131
  73. #define  IDM_COLUMNS          132
  74. #define  IDM_STATISTICS       133
  75. #define  IDM_PRIMARY_KEYS     134
  76. #define  IDM_FOREIGN_KEYS     135
  77. #define  IDM_TABLE_PRIVS      136
  78. #define  IDM_COLUMN_PRIVS     137
  79. #define  IDM_SPECIAL_COLUMNS  138
  80. #define  IDM_PROCEDURES       139
  81. #define  IDM_PROC_COLUMNS     140
  82.  
  83.  
  84. #define  IDM_WINDOW_MENU      6
  85. #define  IDM_FONT             150
  86. #define  IDM_CASCADE          151
  87. #define  IDM_TILE             152
  88. #define  IDM_ARRANGE          153
  89. #define  IDM_CLOSEALL         154
  90.  
  91. #define  IDM_ABOUT_MENU       7
  92. #define  IDM_HELP             160
  93. #define  IDM_ABOUT            161
  94.  
  95. #define  IDM_MOVE_WINDOW      165         // F6 key
  96.  
  97.  
  98.  
  99.  
  100.  
  101. #define MNU_HAVE_CONNECTS ((lpActiveConn) ? MF_ENABLED : MF_GRAYED)
  102.  
  103. // Normally menu numbers start at 0 and go up, which is how each offset is shown
  104. //    in this file.  If a child MDI window is zoomed, however, then the child
  105. //    system menu becomes menu number 0 and others are offset.  The following
  106. //    macro will look at the current active window and return the correct
  107. //    0 based menu number.
  108. #define GETMENUNUM(iMenu) (iMenu - ((hwndCurMDIChild) ? (int)IsZoomed(hwndCurMDIChild) : 0))
  109.  
  110.  
  111. #define CBITS (sizeof(UDWORD) * 8)
  112. #define BitSet(lpa, pos)   \
  113.    (lpa[((pos) / CBITS)] |= 1 << ((pos) - (CBITS * ((pos) / CBITS))))
  114. #define BitClear(lpa, pos) \
  115.    (lpa[((pos) / CBITS)] &= ~(1 << ((pos) - (CBITS * ((pos) / CBITS)))))
  116. #define BitGet(lpa, pos)   \
  117.    (lpa[((pos) / CBITS)] & (1 << ((pos) - (CBITS * ((pos) / CBITS)))))
  118. #define BitFlip(lpa,pos)   \
  119.    (BitGet(lpa,pos)) ? BitClear(lpa,pos) : BitSet(lpa,pos)
  120. #define MINREQUIREDINTS(items) (UDWORD)((items / CBITS) + ((items % CBITS) ? 1 : 0))
  121.  
  122.  
  123.  
  124.  
  125.  
  126. //*---------------------------------------------------------------------------------
  127. //|   Function prototypes
  128. //*---------------------------------------------------------------------------------
  129. VOID WINAPI ResetMenu(HMENU hMenu, int iMenu);
  130.  
  131.  
  132.  
  133. #endif
  134.