Umx.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corporation 1992 - 1999 **/
  4. /**********************************************************************/
  5. /*
  6. umx.h
  7. This file contains the common messages, manifests, types, and
  8. structures used by User Manager Extensions.
  9. NOTE: You must include windows.h and lmcons.h *before* this file.
  10. */
  11. #ifndef _UMX_H_
  12. #define _UMX_H_
  13. //
  14. // This is the maximum length allowed for an extension menu item.
  15. //
  16. #define UME_MENU_TEXT_LEN 50
  17. //
  18. // This is the current version number of the extension interface.
  19. //
  20. #define UME_VERSION 0
  21. //
  22. // These are the two listboxes in the User Manager main window.
  23. //
  24. #define UMS_LISTBOX_USERS 0
  25. #define UMS_LISTBOX_GROUPS 1
  26. //
  27. // These are the messages sent from the extension to the
  28. // User Manager application.
  29. //
  30. // UM_GETSELCOUNT
  31. //
  32. // Purpose - Retrieves the number of selected items in
  33. // the specified listbox.
  34. //
  35. // wParam - Listbox index. This 0-based index specifies
  36. // the listbox to query. For the User Manager,
  37. // this may be either UMS_LISTBOX_USERS or
  38. // UMS_LISTBOX_GROUPS.
  39. //
  40. // lParam - Points to a UMS_GETSELCOUNT structure.
  41. //
  42. // Returns - TRUE if successful, FALSE if unsuccessful.
  43. //
  44. //
  45. // UM_GETUSERSEL[AW]
  46. //
  47. // Purpose - Retrieves a particular selection.
  48. //
  49. // wParam - Selection index. This 0-based index specifies
  50. // the selected item to query. This is used here
  51. // since the Users listbox is multiple-select.
  52. //
  53. // lParam - Points to a UMS_GETSEL[AW] structure.
  54. //
  55. // Returns - TRUE if successful, FALSE if unsuccessful.
  56. //
  57. //
  58. // UM_GETGROUPSEL[AW]
  59. //
  60. // Purpose - Retrieves a particular selection.
  61. //
  62. // wParam - Selection index. This 0-based index specifies
  63. // the selected item to query. This is useful
  64. // for muliple-select listboxes. Since the Groups
  65. // listbox is single-select, this value must always
  66. // be zero.
  67. //
  68. // lParam - Points to a UMS_GETSEL[AW] structure.
  69. //
  70. // Returns - TRUE if successful, FALSE if unsuccessful.
  71. //
  72. //
  73. // UM_GETCURFOCUS[AW]
  74. //
  75. // Purpose - Retrieves the current application focus.
  76. //
  77. // wParam - Must be zero.
  78. //
  79. // lParam - Points to a UMS_GETCURFOCUS structure.
  80. //
  81. // Returns - TRUE if successful, FALSE if unsuccessful.
  82. //
  83. //
  84. // UM_GETOPTIONS[2]
  85. //
  86. // Purpose - Retrieves the current option settings
  87. //
  88. // wParam - Must be zero.
  89. //
  90. // lParam - Points to a UMS_GETOPTIONS[2] structure.
  91. //
  92. // Returns - TRUE if successful, FALSE if unsuccessful.
  93. //
  94. #define UM_GETSELCOUNT (WM_USER + 1000)
  95. #define UM_GETUSERSELA (WM_USER + 1001)
  96. #define UM_GETUSERSELW (WM_USER + 1002)
  97. #define UM_GETGROUPSELA (WM_USER + 1003)
  98. #define UM_GETGROUPSELW (WM_USER + 1004)
  99. #define UM_GETCURFOCUSA (WM_USER + 1005)
  100. #define UM_GETCURFOCUSW (WM_USER + 1006)
  101. #define UM_GETOPTIONS (WM_USER + 1007)
  102. #define UM_GETOPTIONS2 (WM_USER + 1008)
  103. #ifdef UNICODE
  104. #define UM_GETUSERSEL UM_GETUSERSELW
  105. #define UM_GETGROUPSEL UM_GETGROUPSELW
  106. #define UM_GETCURFOCUS UM_GETCURFOCUSW
  107. #else // !UNICODE
  108. #define UM_GETUSERSEL UM_GETUSERSELA
  109. #define UM_GETGROUPSEL UM_GETGROUPSELA
  110. #define UM_GETCURFOCUS UM_GETCURFOCUSA
  111. #endif // UNICODE
  112. //
  113. // These structures are used when the extension is
  114. // communicating with the application.
  115. //
  116. //
  117. // The UMS_LOADMENU[AW] structure is passed to the extension's
  118. // UMELoadMenu[AW] entrypoint when the extension is loaded.
  119. //
  120. // dwVersion - On entry to UMELoadMenu[AW], this will
  121. // contain the maximum extension version
  122. // supported by the User Manager. If the
  123. // extension supports a lower version, it
  124. // should set this field appropriately before
  125. // returning. The User Manager will use
  126. // the returned value to determine the
  127. // capabilities of the extension.
  128. //
  129. // szMenuName - The name of the menu item that is to appear
  130. // in the app's main menu. This value will also
  131. // appear in the "Help On Extensions" submene and
  132. // the "View" menu.
  133. //
  134. // hMenu - A valid HMENU for the popup-menu to be inserted
  135. // into the app's main menu. Ownership of this
  136. // handle transfers to the User Manager. The
  137. // extension should *not* destroy this handle.
  138. //
  139. // szHelpFileName - The name of the help file associated with this
  140. // extension. This file will be used for the
  141. // "Help On Extensions" menu. This will also be
  142. // used when the user presses [F1] while the
  143. // extension's menu is dropped.
  144. //
  145. // dwMenuDelta - The User Manager will apply this delta
  146. // to each menu ID present in hMenu. This is
  147. // to prevent conflicts with other extension's
  148. // menu IDs.
  149. //
  150. typedef struct _UMS_LOADMENUA
  151. {
  152. DWORD dwVersion;
  153. CHAR szMenuName[UME_MENU_TEXT_LEN + 1];
  154. HMENU hMenu;
  155. CHAR szHelpFileName[MAX_PATH];
  156. DWORD dwMenuDelta;
  157. } UMS_LOADMENUA, * PUMS_LOADMENUA;
  158. typedef struct _UMS_LOADMENUW
  159. {
  160. DWORD dwVersion;
  161. WCHAR szMenuName[UME_MENU_TEXT_LEN + 1];
  162. HMENU hMenu;
  163. WCHAR szHelpFileName[MAX_PATH];
  164. DWORD dwMenuDelta;
  165. } UMS_LOADMENUW, * PUMS_LOADMENUW;
  166. #ifdef UNICODE
  167. #define UMS_LOADMENU UMS_LOADMENUW
  168. #define PUMS_LOADMENU PUMS_LOADMENUW
  169. #else // !UNICODE
  170. #define UMS_LOADMENU UMS_LOADMENUA
  171. #define PUMS_LOADMENU PUMS_LOADMENUA
  172. #endif // UNICODE
  173. #define UM_SELTYPE_USER 0x10
  174. #define UM_SELTYPE_NORMALUSER 0x1 | UM_SELTYPE_USER
  175. #define UM_SELTYPE_REMOTEUSER 0x2 | UM_SELTYPE_USER
  176. #define UM_SELTYPE_GROUP 0x20
  177. #define UM_SELTYPE_LOCALGROUP 0x4 | UM_SELTYPE_GROUP
  178. #define UM_SELTYPE_GLOBALGROUP 0x8 | UM_SELTYPE_GROUP
  179. //
  180. // The UMS_GETSEL[AW] structure is filled in by the User Manager
  181. // when it handles UM_GETUSERSEL[AW] or UM_GETGROUPSEL[AW] messages.
  182. // This is used to return the current selection to the extension.
  183. // Note that this structure contains pointers. The extension should not
  184. // assume that these pointers will be valid forever, instead the
  185. // extension should promptly copy these strings and use the copies.
  186. //
  187. // dwRID - The RID of the item. Note that the RID is not
  188. // valid when the UMS_GETSEL describes a group.
  189. //
  190. // pchName - Will receive the name of the selected account.
  191. //
  192. // dwSelType - Will receive the account type mask associated
  193. // with the account.
  194. //
  195. // pchName - Will receive the fullname of the selected account.
  196. // Note that groups do not have fullnames.
  197. //
  198. // pchComment - Will receive the comment of the selected account.
  199. //
  200. typedef struct _UMS_GETSELA
  201. {
  202. DWORD dwRID;
  203. LPSTR pchName;
  204. DWORD dwSelType;
  205. LPSTR pchFullName;
  206. LPSTR pchComment;
  207. } UMS_GETSELA, * PUMS_GETSELA;
  208. typedef struct _UMS_GETSELW
  209. {
  210. DWORD dwRID;
  211. LPWSTR pchName;
  212. DWORD dwSelType;
  213. LPWSTR pchFullName;
  214. LPWSTR pchComment;
  215. } UMS_GETSELW, * PUMS_GETSELW;
  216. #ifdef UNICODE
  217. #define UMS_GETSEL UMS_GETSELW
  218. #define PUMS_GETSEL PUMS_GETSELW
  219. #else // !UNICODE
  220. #define UMS_GETSEL UMS_GETSELA
  221. #define PUMS_GETSEL PUMS_GETSELA
  222. #endif // UNICODE
  223. //
  224. // The UMS_GETSELCOUNT structure is filled in by the User Manager
  225. // when it handles the UM_GETSELCOUNT message. This is used to
  226. // return the number of selected items to the extension. This could
  227. // be more than 1 for the user listbox.
  228. //
  229. // dwItems - The number of selected items in the listbox.
  230. //
  231. typedef struct _UMS_GETSELCOUNT
  232. {
  233. DWORD dwItems;
  234. } UMS_GETSELCOUNT, * PUMS_GETSELCOUNT;
  235. //
  236. // The UMS_GETCURFOCUS structure is filled in by the User Manager
  237. // when it handles the UM_GETCURFOCUS message. This is used to
  238. // return the current focus of the User Manager application.
  239. //
  240. // szFocus - The domain name or server name of the current
  241. // focus. Server names can be distinguished
  242. // by the leading backslashes, or by dwFocusType.
  243. //
  244. // dwFocusType - This is the type of focus, either
  245. // UM_FOCUS_TYPE_DOMAIN (and szFocus is a domain name)
  246. // UM_FOCUS_TYPE_WINNT (and szFocus is a server name)
  247. // UM_FOCUS_TYPE_LM (and szFocus is a server name)
  248. // UM_FOCUS_TYPE_UNKNOWN
  249. //
  250. // szFocusPDC - This is the PDC of the domain of focus, and is valid
  251. // only if focus is set to UM_FOCUS_TYPE_DOMAIN.
  252. //
  253. // psidFocus - This points to the SID of the domain of focus. It
  254. // may be NULL. Note that this pointer will not be
  255. // valid forever, the extension should copy the SID
  256. // immediately if it intends to use it.
  257. //
  258. #define UM_FOCUS_TYPE_DOMAIN 1
  259. #define UM_FOCUS_TYPE_WINNT 2
  260. #define UM_FOCUS_TYPE_LM 3
  261. #define UM_FOCUS_TYPE_UNKNOWN 4
  262. typedef struct _UMS_GETCURFOCUSA
  263. {
  264. CHAR szFocus[MAX_PATH];
  265. DWORD dwFocusType;
  266. CHAR szFocusPDC[MAX_PATH];
  267. PVOID psidFocus; // actually a SID pointer
  268. } UMS_GETCURFOCUSA, * PUMS_GETCURFOCUSA;
  269. typedef struct _UMS_GETCURFOCUSW
  270. {
  271. WCHAR szFocus[MAX_PATH];
  272. DWORD dwFocusType;
  273. WCHAR szFocusPDC[MAX_PATH];
  274. PVOID psidFocus; // actually a SID pointer
  275. } UMS_GETCURFOCUSW, * PUMS_GETCURFOCUSW;
  276. #ifdef UNICODE
  277. #define UMS_GETCURFOCUS UMS_GETCURFOCUSW
  278. #define PUMS_GETCURFOCUS PUMS_GETCURFOCUSW
  279. #else // UNICODE
  280. #define UMS_GETCURFOCUS UMS_GETCURFOCUSA
  281. #define PUMS_GETCURFOCUS PUMS_GETCURFOCUSA
  282. #endif // UNICODE
  283. //
  284. // The UMS_GETOPTIONS[2] structure is filled in by the User Manager
  285. // when it handles the UM_GETOPTIONS[2] message. This is used to
  286. // return the current option settings of the User Manager application.
  287. //
  288. // fSaveSettingsOnExit - Should User Manager settings be saved on exit?
  289. //
  290. // fConfirmation - Should permanent and/or dangerous actions be
  291. // confirmed?
  292. //
  293. // fSortByFullName - Should the main user listbox be sorted by
  294. // fullname rather than by user name?
  295. //
  296. // fMiniUserManager - (UMS_GETOPTIONS2 only) Is this the User Manager
  297. // rather than the User Manager for Domains?
  298. //
  299. // fLowSpeedConnection - (UMS_GETOPTIONS2 only) Is the User Manager
  300. // optimized for use across a slow network link?
  301. //
  302. typedef struct _UMS_GETOPTIONS
  303. {
  304. BOOL fSaveSettingsOnExit;
  305. BOOL fConfirmation;
  306. BOOL fSortByFullName;
  307. } UMS_GETOPTIONS, * PUMS_GETOPTIONS;
  308. typedef struct _UMS_GETOPTIONS2
  309. {
  310. BOOL fSaveSettingsOnExit;
  311. BOOL fConfirmation;
  312. BOOL fSortByFullName;
  313. BOOL fMiniUserManager;
  314. BOOL fLowSpeedConnection;
  315. } UMS_GETOPTIONS2, * PUMS_GETOPTIONS2;
  316. //
  317. // These are the names of the extension entrypoints.
  318. //
  319. #define SZ_UME_UNLOADMENU "UMEUnloadMenu"
  320. #define SZ_UME_INITIALIZEMENU "UMEInitializeMenu"
  321. #define SZ_UME_REFRESH "UMERefresh"
  322. #define SZ_UME_MENUACTION "UMEMenuAction"
  323. #define SZ_UME_LOADMENUW "UMELoadMenuW"
  324. #define SZ_UME_GETEXTENDEDERRORSTRINGW "UMEGetExtendedErrorStringW"
  325. #define SZ_UME_CREATEW "UMECreateW"
  326. #define SZ_UME_DELETEW "UMEDeleteW"
  327. #define SZ_UME_RENAMEW "UMERenameW"
  328. #define SZ_UME_LOADMENUA "UMELoadMenuA"
  329. #define SZ_UME_GETEXTENDEDERRORSTRINGA "UMEGetExtendedErrorStringA"
  330. #define SZ_UME_CREATEA "UMECreateA"
  331. #define SZ_UME_DELETEA "UMEDeleteA"
  332. #define SZ_UME_RENAMEA "UMERenameA"
  333. #ifdef UNICODE
  334. #define SZ_UME_LOADMENU SZ_UME_LOADMENUW
  335. #define SZ_UME_GETEXTENDEDERRORSTRING SZ_UME_GETEXTENDEDERRORSTRINGW
  336. #define SZ_UME_CREATE SZ_UME_CREATEW
  337. #define SZ_UME_DELETE SZ_UME_DELETEW
  338. #define SZ_UME_RENAME SZ_UME_RENAMEW
  339. #else // !UNICODE
  340. #define SZ_UME_LOADMENU SZ_UME_LOADMENUA
  341. #define SZ_UME_GETEXTENDEDERRORSTRING SZ_UME_GETEXTENDEDERRORSTRINGA
  342. #define SZ_UME_CREATE SZ_UME_CREATEA
  343. #define SZ_UME_DELETE SZ_UME_DELETEA
  344. #define SZ_UME_RENAME SZ_UME_RENAMEA
  345. #endif // UNICODE
  346. //
  347. // Typedefs for the extension entrypoints.
  348. //
  349. typedef DWORD (PASCAL * PUMX_LOADMENUW)( HWND hWnd,
  350. PUMS_LOADMENUW pumsload );
  351. typedef DWORD (PASCAL * PUMX_LOADMENUA)( HWND hWnd,
  352. PUMS_LOADMENUA pumsload );
  353. typedef LPWSTR (PASCAL * PUMX_GETEXTENDEDERRORSTRINGW)( VOID );
  354. typedef LPSTR (PASCAL * PUMX_GETEXTENDEDERRORSTRINGA)( VOID );
  355. typedef VOID (PASCAL * PUMX_UNLOADMENU)( VOID );
  356. typedef VOID (PASCAL * PUMX_INITIALIZEMENU)( VOID );
  357. typedef VOID (PASCAL * PUMX_REFRESH)( HWND hwndParent );
  358. typedef VOID (PASCAL * PUMX_MENUACTION)( HWND hwndParent,
  359. DWORD dwEventId );
  360. typedef VOID (PASCAL * PUMX_CREATEW)( HWND hwndParent,
  361. PUMS_GETSELW pumsSelection );
  362. typedef VOID (PASCAL * PUMX_CREATEA)( HWND hwndParent,
  363. PUMS_GETSELA pumsSelection );
  364. typedef VOID (PASCAL * PUMX_DELETEW)( HWND hwndParent,
  365. PUMS_GETSELW pumsSelection );
  366. typedef VOID (PASCAL * PUMX_DELETEA)( HWND hwndParent,
  367. PUMS_GETSELA pumsSelection );
  368. typedef VOID (PASCAL * PUMX_RENAMEW)( HWND hwndParent,
  369. PUMS_GETSELW pumsSelection,
  370. LPWSTR pchNewName );
  371. typedef VOID (PASCAL * PUMX_RENAMEA)( HWND hwndParent,
  372. PUMS_GETSELA pumsSelection,
  373. LPSTR pchNewName );
  374. #ifdef UNICODE
  375. #define PUMX_LOADMENU PUMX_LOADMENUW
  376. #define PUMX_GETEXTENDEDERRORSTRING PUMX_GETEXTENDEDERRORSTRINGW
  377. #define PUMX_CREATE PUMX_CREATEW
  378. #define PUMX_DELETE PUMX_DELETEW
  379. #define PUMX_RENAME PUMX_RENAMEW
  380. #else // !UNICODE
  381. #define PUMX_LOADMENU PUMX_LOADMENUA
  382. #define PUMX_GETEXTENDEDERRORSTRING PUMX_GETEXTENDEDERRORSTRINGA
  383. #define PUMX_CREATE PUMX_CREATEA
  384. #define PUMX_DELETE PUMX_DELETEA
  385. #define PUMX_RENAME PUMX_RENAMEA
  386. #endif // UNICODE
  387. //
  388. // Prototypes for the extension entrypoints.
  389. //
  390. DWORD PASCAL UMELoadMenuA( HWND hwndMessage,
  391. PUMS_LOADMENUA pumsload );
  392. DWORD PASCAL UMELoadMenuW( HWND hwndMessage,
  393. PUMS_LOADMENUW pumsload );
  394. LPSTR PASCAL UMEGetExtendedErrorStringA( VOID );
  395. LPWSTR PASCAL UMEGetExtendedErrorStringW( VOID );
  396. VOID PASCAL UMEUnloadMenu( VOID );
  397. VOID PASCAL UMEInitializeMenu( VOID );
  398. VOID PASCAL UMERefresh( HWND hwndParent );
  399. VOID PASCAL UMEMenuAction( HWND hwndParent,
  400. DWORD dwEventId );
  401. VOID PASCAL UMECreateA( HWND hwndParent,
  402. PUMS_GETSELA pumsSelection );
  403. VOID PASCAL UMECreateW( HWND hwndParent,
  404. PUMS_GETSELW pumsSelection );
  405. VOID PASCAL UMEDeleteA( HWND hwndParent,
  406. PUMS_GETSELA pumsSelection );
  407. VOID PASCAL UMEDeleteW( HWND hwndParent,
  408. PUMS_GETSELW pumsSelection );
  409. VOID PASCAL UMERenameA( HWND hwndParent,
  410. PUMS_GETSELA pumsSelection,
  411. LPSTR pchNewName );
  412. VOID PASCAL UMERenameW( HWND hwndParent,
  413. PUMS_GETSELW pumsSelection,
  414. LPWSTR pchNewName );
  415. #endif // _UMX_H_