Smx.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corporation 1992 - 1999 **/
  4. /**********************************************************************/
  5. /*
  6. smx.h
  7. This file contains the common messages, manifests, types, and
  8. structures used by Server Manager Extensions.
  9. NOTE: You must include windows.h and lmcons.h *before* this file.
  10. */
  11. #ifndef _SMX_H_
  12. #define _SMX_H_
  13. //
  14. // This is the maximum length allowed for an extension menu item.
  15. //
  16. #define MENU_TEXT_LEN 50
  17. //
  18. // This is the current version number of the extension interface.
  19. //
  20. #define SME_VERSION 0
  21. //
  22. // These are the messages sent from the extension to the
  23. // Server Manager application.
  24. //
  25. // SM_GETSELCOUNT
  26. //
  27. // Purpose - Retrieves the number of selected items in
  28. // the specified listbox.
  29. //
  30. // wParam - Listbox index. This 0-based index specifies
  31. // the listbox to query. For the Server Manager,
  32. // this must always be zero.
  33. //
  34. // lParam - Points to an SMS_GETSELCOUNT structure.
  35. //
  36. // Returns - TRUE if successful, FALSE if unsuccessful.
  37. //
  38. //
  39. // SM_GETSERVERSEL[A]
  40. //
  41. // Purpose - Retrieves a particular selection.
  42. //
  43. // wParam - Selection index. This 0-based index specifies
  44. // the selected item to query. This is useful
  45. // for muliple-select listboxes. Since the Server
  46. // manager uses a single-select listbox, this
  47. // value must always be zero.
  48. //
  49. // lParam - Points to an SMS_GETSERVERSEL[AW] structure.
  50. //
  51. // Returns - TRUE if successful, FALSE if unsuccessful.
  52. //
  53. // SM_GETCURFOCUS[AW]
  54. //
  55. // Purpose - Retrieves the current application focus.
  56. //
  57. // wParam - Must be zero.
  58. //
  59. // lParam - Points to a SMS_GETCURFOCUS structure.
  60. //
  61. // Returns - TRUE if successful, FALSE if unsuccessful.
  62. //
  63. //
  64. // SM_GETOPTIONS
  65. //
  66. // Purpose - Retrieves the current option settings
  67. //
  68. // wParam - Must be zero.
  69. //
  70. // lParam - Points to a SMS_GETOPTIONS structure.
  71. //
  72. // Returns - TRUE if successful, FALSE if unsuccessful.
  73. //
  74. #define SM_GETSELCOUNT (WM_USER + 1000)
  75. #define SM_GETSERVERSELA (WM_USER + 1001)
  76. #define SM_GETSERVERSELW (WM_USER + 1002)
  77. #define SM_GETCURFOCUSA (WM_USER + 1003)
  78. #define SM_GETCURFOCUSW (WM_USER + 1004)
  79. #define SM_GETOPTIONS (WM_USER + 1005)
  80. #ifdef UNICODE
  81. #define SM_GETSERVERSEL SM_GETSERVERSELW
  82. #define SM_GETCURFOCUS SM_GETCURFOCUSW
  83. #else // !UNICODE
  84. #define SM_GETSERVERSEL SM_GETSERVERSELA
  85. #define SM_GETCURFOCUS SM_GETCURFOCUSA
  86. #endif // UNICODE
  87. //
  88. // These structures are used when the extension is
  89. // communicating with the application.
  90. //
  91. //
  92. // The SMS_LOADMENU[AW] structure is passed to the extension's
  93. // SMELoadMenu[AW] entrypoint when the extension is loaded.
  94. //
  95. // dwVersion - On entry to SMELoadMenu[AW], this will
  96. // contain the maximum extension version
  97. // supported by the Server Manager. If the
  98. // extension supports a lower version, it
  99. // should set this field appropriately before
  100. // returning. The Server Manager will use
  101. // the returned value to determine the
  102. // capabilities of the extension.
  103. //
  104. // szMenuName - The name of the menu item that is to appear
  105. // in the app's main menu. This value will also
  106. // appear in the "Help On Extensions" submene and
  107. // the "View" menu.
  108. //
  109. // hMenu - A valid HMENU for the popup-menu to be inserted
  110. // into the app's main menu. Ownership of this
  111. // handle transfers to the Server Manager. The
  112. // extension should *not* destroy this handle.
  113. //
  114. // szHelpFileName - The name of the help file associated with this
  115. // extension. This file will be used for the
  116. // "Help On Extensions" menu. This will also be
  117. // used when the user presses [F1] while the
  118. // extension's menu is dropped.
  119. //
  120. // dwServerType - A bitmask containing the appropriate server type
  121. // bit associated with the extension. It is
  122. // assumed that each extension will be associated
  123. // with a unique server type. For example,
  124. // SV_TYPE_WFW represents Windows for Workgroups
  125. // servers.
  126. //
  127. // dwMenuDelta - The Server Manager will apply this delta
  128. // to each menu ID present in hMenu. This is
  129. // to prevent conflicts with other extension's
  130. // menu IDs.
  131. //
  132. typedef struct _SMS_LOADMENUA
  133. {
  134. DWORD dwVersion;
  135. CHAR szMenuName[MENU_TEXT_LEN + 1];
  136. HMENU hMenu;
  137. CHAR szHelpFileName[MAX_PATH];
  138. DWORD dwServerType;
  139. DWORD dwMenuDelta;
  140. } SMS_LOADMENUA, * PSMS_LOADMENUA;
  141. typedef struct _SMS_LOADMENUW
  142. {
  143. DWORD dwVersion;
  144. WCHAR szMenuName[MENU_TEXT_LEN + 1];
  145. HMENU hMenu;
  146. WCHAR szHelpFileName[MAX_PATH];
  147. DWORD dwServerType;
  148. DWORD dwMenuDelta;
  149. } SMS_LOADMENUW, * PSMS_LOADMENUW;
  150. #ifdef UNICODE
  151. #define SMS_LOADMENU SMS_LOADMENUW
  152. #define PSMS_LOADMENU PSMS_LOADMENUW
  153. #else // !UNICODE
  154. #define SMS_LOADMENU SMS_LOADMENUA
  155. #define PSMS_LOADMENU PSMS_LOADMENUA
  156. #endif // UNICODE
  157. //
  158. // The SMS_GETSERVERSEL[AW] structure is filled in by the
  159. // Server Manager when it handles SM_GETSERVERSEL[AW] messages.
  160. // This is used to return the current selection to the extension.
  161. //
  162. // szServerName - Will receive the UNC name of the selected
  163. // server.
  164. //
  165. // dwServerType - Will receive the server type mask associated
  166. // with the server. This field may be 0 if
  167. // the type is unknown.
  168. //
  169. typedef struct _SMS_GETSERVERSELA
  170. {
  171. CHAR szServerName[MAX_PATH];
  172. DWORD dwServerType;
  173. } SMS_GETSERVERSELA, * PSMS_GETSERVERSELA;
  174. typedef struct _SMS_GETSERVERSELW
  175. {
  176. WCHAR szServerName[MAX_PATH];
  177. DWORD dwServerType;
  178. } SMS_GETSERVERSELW, * PSMS_GETSERVERSELW;
  179. #ifdef UNICODE
  180. #define SMS_GETSERVERSEL SMS_GETSERVERSELW
  181. #define PSMS_GETSERVERSEL PSMS_GETSERVERSELW
  182. #else // !UNICODE
  183. #define SMS_GETSERVERSEL SMS_GETSERVERSELA
  184. #define PSMS_GETSERVERSEL PSMS_GETSERVERSELA
  185. #endif // UNICODE
  186. //
  187. // The SMS_GETSELCOUNT structure is filled in by the Server Manager
  188. // when it handles the SM_GETSELCOUNT message. This is used to
  189. // return the number of selected items to the extension. In the
  190. // current implementation, this will be either 0 (empty listbox)
  191. // or 1 (single selection).
  192. //
  193. // dwItems - The number of selected items in the listbox.
  194. //
  195. typedef struct _SMS_GETSELCOUNT
  196. {
  197. DWORD dwItems;
  198. } SMS_GETSELCOUNT, * PSMS_GETSELCOUNT;
  199. //
  200. // The SMS_GETCURFOCUS[AW] structure is filled in by the Server Manager
  201. // when it handles the SM_GETCURFOCUS message. This is used to
  202. // return the current focus of the User Manager application.
  203. //
  204. // szFocus - The domain name or server name of the current
  205. // focus. Server names can be distinguished
  206. // by the leading backslashes, or by dwFocusType.
  207. //
  208. // dwFocusType - This is the type of focus, either
  209. // SM_FOCUS_TYPE_NT_DOMAIN
  210. // SM_FOCUS_TYPE_LM_DOMAIN
  211. // SM_FOCUS_TYPE_UNKNOWN_DOMAIN
  212. // SM_FOCUS_TYPE_NT_SERVER
  213. // SM_FOCUS_TYPE_LM_SERVER
  214. // SM_FOCUS_TYPE_WFW_SERVER
  215. // SM_FOCUS_TYPE_UNKNOWN_SERVER
  216. //
  217. #define SM_FOCUS_TYPE_NT_DOMAIN 1
  218. #define SM_FOCUS_TYPE_LM_DOMAIN 2
  219. #define SM_FOCUS_TYPE_UNKNOWN_DOMAIN 3
  220. #define SM_FOCUS_TYPE_NT_SERVER 4
  221. #define SM_FOCUS_TYPE_LM_SERVER 5
  222. #define SM_FOCUS_TYPE_WFW_SERVER 6
  223. #define SM_FOCUS_TYPE_UNKNOWN_SERVER 7
  224. typedef struct _SMS_GETCURFOCUSA
  225. {
  226. CHAR szFocus[MAX_PATH];
  227. DWORD dwFocusType;
  228. } SMS_GETCURFOCUSA, * PSMS_GETCURFOCUSA;
  229. typedef struct _SMS_GETCURFOCUSW
  230. {
  231. WCHAR szFocus[MAX_PATH];
  232. DWORD dwFocusType;
  233. } SMS_GETCURFOCUSW, * PSMS_GETCURFOCUSW;
  234. #ifdef UNICODE
  235. #define SMS_GETCURFOCUS SMS_GETCURFOCUSW
  236. #define PSMS_GETCURFOCUS PSMS_GETCURFOCUSW
  237. #else // UNICODE
  238. #define SMS_GETCURFOCUS SMS_GETCURFOCUSA
  239. #define PSMS_GETCURFOCUS PSMS_GETCURFOCUSA
  240. #endif // UNICODE
  241. //
  242. // The SMS_GETOPTIONS structure is filled in by the Server Manager
  243. // when it handles the SM_GETOPTIONS message. This is used to
  244. // return the current option settings of the Server Manager
  245. // application.
  246. //
  247. // fSaveSettingsOnExit - Should Server Manager settings be saved
  248. // on exit?
  249. //
  250. // fConfirmation - Should permanent and/or dangerous
  251. // actions be confirmed? In the current
  252. // Server Manager implementation, this
  253. // will always be TRUE.
  254. //
  255. typedef struct _SMS_GETOPTIONS
  256. {
  257. BOOL fSaveSettingsOnExit;
  258. BOOL fConfirmation;
  259. } SMS_GETOPTIONS, * PSMS_GETOPTIONS;
  260. //
  261. // The SMS_VALIDATE[AW] structure is passed between the Server Manager
  262. // application and the extension to validate a particular "alien"
  263. // (non-LANMan) server.
  264. //
  265. // pszServer - The (UNC) name of the server to validate. This
  266. // is filled in by the Server Manager.
  267. //
  268. // pszType - The type string to display in the Server Manager's
  269. // main window. This is filled in by the extension.
  270. //
  271. // pszComment - The comment to display in the Server Manager's
  272. // main window. This is filled in by the extension.
  273. //
  274. typedef struct _SMS_VALIDATEA
  275. {
  276. const CHAR * pszServer;
  277. CHAR * pszType;
  278. CHAR * pszComment;
  279. } SMS_VALIDATEA, * PSMS_VALIDATEA;
  280. typedef struct _SMS_VALIDATEW
  281. {
  282. const WCHAR * pszServer;
  283. WCHAR * pszType;
  284. WCHAR * pszComment;
  285. } SMS_VALIDATEW, * PSMS_VALIDATEW;
  286. #ifdef UNICODE
  287. #define SMS_VALIDATE SMS_VALIDATEW
  288. #define PSMS_VALIDATE PSMS_VALIDATEW
  289. #else // UNICODE
  290. #define SMS_VALIDATE SMS_VALIDATEA
  291. #define PSMS_VALIDATE PSMS_VALIDATEA
  292. #endif // UNICODE
  293. //
  294. // These are the names of the extension entrypoints.
  295. //
  296. #define SZ_SME_UNLOADMENU "SMEUnloadMenu"
  297. #define SZ_SME_INITIALIZEMENU "SMEInitializeMenu"
  298. #define SZ_SME_REFRESH "SMERefresh"
  299. #define SZ_SME_MENUACTION "SMEMenuAction"
  300. #define SZ_SME_LOADMENUW "SMELoadMenuW"
  301. #define SZ_SME_GETEXTENDEDERRORSTRINGW "SMEGetExtendedErrorStringW"
  302. #define SZ_SME_VALIDATEW "SMEValidateW"
  303. #define SZ_SME_LOADMENUA "SMELoadMenuA"
  304. #define SZ_SME_GETEXTENDEDERRORSTRINGA "SMEGetExtendedErrorStringA"
  305. #define SZ_SME_VALIDATEA "SMEValidateA"
  306. #ifdef UNICODE
  307. #define SZ_SME_LOADMENU SZ_SME_LOADMENUW
  308. #define SZ_SME_GETEXTENDEDERRORSTRING SZ_SME_GETEXTENDEDERRORSTRINGW
  309. #define SZ_SME_VALIDATE SZ_SME_VALIDATEW
  310. #else // !UNICODE
  311. #define SZ_SME_LOADMENU SZ_SME_LOADMENUA
  312. #define SZ_SME_GETEXTENDEDERRORSTRING SZ_SME_GETEXTENDEDERRORSTRINGA
  313. #define SZ_SME_VALIDATE SZ_SME_VALIDATEA
  314. #endif // UNICODE
  315. //
  316. // Typedefs for the extension entrypoints.
  317. //
  318. typedef DWORD (PASCAL * PSMX_LOADMENU)( HWND hWnd,
  319. PSMS_LOADMENU psmsload );
  320. typedef LPTSTR (PASCAL * PSMX_GETEXTENDEDERRORSTRING)( VOID );
  321. typedef VOID (PASCAL * PSMX_UNLOADMENU)( VOID );
  322. typedef VOID (PASCAL * PSMX_INITIALIZEMENU)( VOID );
  323. typedef VOID (PASCAL * PSMX_REFRESH)( HWND hwndParent );
  324. typedef VOID (PASCAL * PSMX_MENUACTION)( HWND hwndParent, DWORD dwEventId );
  325. typedef BOOL (PASCAL * PSMX_VALIDATE)( PSMS_VALIDATE psmsvalidate );
  326. //
  327. // Prototypes for the extension entrypoints.
  328. //
  329. DWORD PASCAL SMELoadMenuA( HWND hWnd,
  330. PSMS_LOADMENUA psmsload );
  331. DWORD PASCAL SMELoadMenuW( HWND hWnd,
  332. PSMS_LOADMENUW psmsload );
  333. LPSTR PASCAL SMEGetExtendedErrorStringA( VOID );
  334. LPWSTR PASCAL SMEGetExtendedErrorStringW( VOID );
  335. VOID PASCAL SMEUnloadMenu( VOID );
  336. VOID PASCAL SMEInitializeMenu( VOID );
  337. VOID PASCAL SMERefresh( HWND hwndParent );
  338. VOID PASCAL SMEMenuAction( HWND hwndParent, DWORD dwEventId );
  339. BOOL PASCAL SMEValidateA( PSMS_VALIDATEA psmsValidate );
  340. BOOL PASCAL SMEValidateW( PSMS_VALIDATEW psmsValidate );
  341. #endif // _SMX_H_