Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

204 lines
8.1 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Windows NT Active Directory Service Property Pages
  4. //
  5. // Microsoft Windows
  6. // Copyright (C) Microsoft Corporation, 1992-1999.
  7. //
  8. // File: adsprop.h
  9. //
  10. // Contents: Functions and definitions used in the creation of AD property
  11. // sheets.
  12. //
  13. // History: 28-Sept-98 Eric Brown created.
  14. //
  15. //-----------------------------------------------------------------------------
  16. #ifndef _ADSPROP_H_
  17. #define _ADSPROP_H_
  18. #if _MSC_VER > 1000
  19. #pragma once
  20. #endif
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. #define WM_ADSPROP_NOTIFY_PAGEINIT (WM_USER + 1101) // where LPARAM is the PADSPROPINITPARAMS pointer.
  25. #define WM_ADSPROP_NOTIFY_PAGEHWND (WM_USER + 1102) // where WPARAM => page's HWND and LPARAM => page's Title
  26. #define WM_ADSPROP_NOTIFY_CHANGE (WM_USER + 1103) // used to send a change notification to a parent sheet
  27. #define WM_ADSPROP_NOTIFY_APPLY (WM_USER + 1104) // pages send this to the notification object.
  28. #define WM_ADSPROP_NOTIFY_SETFOCUS (WM_USER + 1105) // used internally by the notification object.
  29. #define WM_ADSPROP_NOTIFY_FOREGROUND (WM_USER + 1106) // used internally by the notification object.
  30. #define WM_ADSPROP_NOTIFY_EXIT (WM_USER + 1107) // sent on page release
  31. #define WM_ADSPROP_NOTIFY_ERROR (WM_USER + 1110) // used to send the notification object an error message
  32. //+----------------------------------------------------------------------------
  33. //
  34. // Structure: ADSPROPINITPARAMS
  35. //
  36. // Usage: Used to pass page initialization information to new pages from
  37. // the notify object.
  38. //
  39. //-----------------------------------------------------------------------------
  40. typedef struct _ADSPROPINITPARAMS {
  41. DWORD dwSize; // Set this to the size of the struct.
  42. DWORD dwFlags; // Reserved for future use.
  43. HRESULT hr; // If this is non-zero, then the others
  44. IDirectoryObject * pDsObj; // should be ignored.
  45. LPWSTR pwzCN;
  46. PADS_ATTR_INFO pWritableAttrs;
  47. } ADSPROPINITPARAMS, * PADSPROPINITPARAMS;
  48. //+----------------------------------------------------------------------------
  49. //
  50. // Structure: ADSPROPERROR
  51. //
  52. // Usage: Used to pass page error information to the notify object
  53. //
  54. //-----------------------------------------------------------------------------
  55. typedef struct _ADSPROPERROR {
  56. HWND hwndPage; // The HWND of the page that had the error
  57. PWSTR pszPageTitle; // The title of the page that had the error
  58. PWSTR pszObjPath; // Path to the object that the error occurred on
  59. PWSTR pszObjClass; // Class of the object that the error occurred on
  60. HRESULT hr; // If this is non-zero, then the others
  61. // pszError will be ignored
  62. PWSTR pszError; // An error message. Used only if hr is zero
  63. } ADSPROPERROR, * PADSPROPERROR;
  64. //+----------------------------------------------------------------------------
  65. //
  66. // Function: ADsPropCreateNotifyObj
  67. //
  68. // Synopsis: Checks to see if the notification window/object exists for this
  69. // sheet instance and if not creates it.
  70. //
  71. // Arguments: [pAppThdDataObj] - the unmarshalled data object pointer.
  72. // [pwzADsObjName] - object path name.
  73. // [phNotifyObj] - to return the notificion window handle.
  74. //
  75. // Returns: HRESULTs.
  76. //
  77. //-----------------------------------------------------------------------------
  78. STDAPI
  79. ADsPropCreateNotifyObj(LPDATAOBJECT pAppThdDataObj, PWSTR pwzADsObjName,
  80. HWND * phNotifyObj);
  81. //+----------------------------------------------------------------------------
  82. //
  83. // Function: ADsPropGetInitInfo
  84. //
  85. // Synopsis: Pages call this at their init time to retreive DS object info.
  86. //
  87. // Arguments: [hNotifyObj] - the notificion window handle.
  88. // [pInitParams] - struct filled in with DS object info. This
  89. // struct must be allocated by the caller before
  90. // the call.
  91. //
  92. // Returns: FALSE if the notify window has gone away for some reason or
  93. // if the parameters are invalid.
  94. //
  95. // Notes: This call results in the sending of the
  96. // WM_ADSPROP_NOTIFY_PAGEINIT message to the notify window.
  97. // pInitParams->pWritableAttrs can be NULL if there are no
  98. // writable attributes.
  99. //
  100. //-----------------------------------------------------------------------------
  101. STDAPI_(BOOL)
  102. ADsPropGetInitInfo(HWND hNotifyObj, PADSPROPINITPARAMS pInitParams);
  103. //+----------------------------------------------------------------------------
  104. //
  105. // Function: ADsPropSetHwndWithTitle
  106. //
  107. // Synopsis: Pages call this at their dialog init time to send their hwnd
  108. // to the Notify object.
  109. //
  110. // Arguments: [hNotifyObj] - the notificion window handle.
  111. // [hPage] - the page's window handle.
  112. // [ptzTitle] - the page's title
  113. //
  114. // Returns: FALSE if the notify window has gone away for some reason.
  115. //
  116. // Notes: Sends the WM_ADSPROP_NOTIFY_PAGEHWND message to the notify
  117. // window. Use this function instead of ADsPropSetHwnd for
  118. // multi-select property pages
  119. //
  120. //-----------------------------------------------------------------------------
  121. STDAPI_(BOOL)
  122. ADsPropSetHwndWithTitle(HWND hNotifyObj, HWND hPage, PTSTR ptzTitle);
  123. //+----------------------------------------------------------------------------
  124. //
  125. // Function: ADsPropSetHwnd
  126. //
  127. // Synopsis: Pages call this at their dialog init time to send their hwnd
  128. // to the Notify object.
  129. //
  130. // Arguments: [hNotifyObj] - the notificion window handle.
  131. // [hPage] - the page's window handle.
  132. //
  133. // Returns: FALSE if the notify window has gone away for some reason.
  134. //
  135. // Notes: Sends the WM_ADSPROP_NOTIFY_PAGEHWND message to the notify
  136. // window.
  137. //
  138. //-----------------------------------------------------------------------------
  139. STDAPI_(BOOL)
  140. ADsPropSetHwnd(HWND hNotifyObj, HWND hPage);
  141. //+----------------------------------------------------------------------------
  142. //
  143. // function: ADsPropCheckIfWritable
  144. //
  145. // Synopsis: See if the attribute is writable by checking if it is in
  146. // the allowedAttributesEffective array.
  147. //
  148. // Arguments: [pwzAttr] - the attribute name.
  149. // [pWritableAttrs] - the array of writable attributes.
  150. //
  151. // Returns: FALSE if the attribute name is not found in the writable-attrs
  152. // array or if the array pointer is NULL.
  153. //
  154. //-----------------------------------------------------------------------------
  155. STDAPI_(BOOL)
  156. ADsPropCheckIfWritable(const PWSTR pwzAttr, const PADS_ATTR_INFO pWritableAttrs);
  157. //+----------------------------------------------------------------------------
  158. //
  159. // function: ADsPropSendErrorMessage
  160. //
  161. // Synopsis: Adds an error message to a list which is presented when
  162. // ADsPropShowErrorDialog is called
  163. //
  164. // Arguments: [hNotifyObj] - the notificion window handle.
  165. // [pError] - the error structure
  166. //
  167. // Returns: FALSE if the notify window has gone away for some reason.
  168. //
  169. //-----------------------------------------------------------------------------
  170. STDAPI_(BOOL)
  171. ADsPropSendErrorMessage(HWND hNotifyObj, PADSPROPERROR pError);
  172. //+----------------------------------------------------------------------------
  173. //
  174. // function: ADsPropShowErrorDialog
  175. //
  176. // Synopsis: Presents an error dialog with the error messages accumulated
  177. // through calls to ADsPropSendErrorMessage
  178. //
  179. // Arguments: [hNotifyObj] - the notificion window handle.
  180. // [hPage] - the property page window handle.
  181. //
  182. // Returns: FALSE if the notify window has gone away for some reason.
  183. //
  184. //-----------------------------------------------------------------------------
  185. STDAPI_(BOOL)
  186. ADsPropShowErrorDialog(HWND hNotifyObj, HWND hPage);
  187. #ifdef __cplusplus
  188. }
  189. #endif // __cplusplus
  190. #endif // _ADSPROP_H_