Leaked source code of windows server 2003
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.

396 lines
7.3 KiB

  1. /* Copyright (c) 1995, Microsoft Corporation, all rights reserved
  2. **
  3. ** uiutil.h
  4. ** UI helper routines
  5. ** Public header
  6. **
  7. ** 08/25/95 Steve Cobb
  8. */
  9. #ifndef _UIUTIL_H_
  10. #define _UIUTIL_H_
  11. #include <nouiutil.h>
  12. /* IP address custom control definitions.
  13. */
  14. #ifndef EXCL_IPADDR_H
  15. #include <ipaddr.h>
  16. #endif
  17. /* Error and Message dialog definitions.
  18. */
  19. #ifndef EXCL_POPUPDLG_H
  20. #include <popupdlg.h>
  21. #endif
  22. /*----------------------------------------------------------------------------
  23. ** Constants/datatypes
  24. **----------------------------------------------------------------------------
  25. */
  26. /* ListView of devices indices.
  27. */
  28. #define DI_Modem 0
  29. #define DI_Adapter 1
  30. #define DI_Direct 2
  31. #define DI_Phone 3
  32. #define UI_Connections_User 0
  33. #define NI_Protocol 0
  34. #define NI_Service 1
  35. #define NI_Client 2
  36. /* Bitmap styles for use with Button_CreateBitmap.
  37. */
  38. #define BMS_OnLeft 0x100
  39. #define BMS_OnRight 0x200
  40. #define BITMAPSTYLE enum tagBITMAPSTYLE
  41. BITMAPSTYLE
  42. {
  43. BMS_UpArrowOnLeft = BMS_OnLeft,
  44. BMS_DownArrowOnLeft,
  45. BMS_UpTriangleOnLeft,
  46. BMS_DownTriangleOnLeft,
  47. BMS_UpArrowOnRight = BMS_OnRight,
  48. BMS_DownArrowOnRight,
  49. BMS_UpTriangleOnRight,
  50. BMS_DownTriangleOnRight
  51. };
  52. /* The extended list view control calls the owner back to find out the layout
  53. ** and desired characteristics of the enhanced list view.
  54. */
  55. #define LVX_MaxCols 10
  56. #define LVX_MaxColTchars 512
  57. /* 'dwFlags' option bits.
  58. */
  59. #define LVXDI_DxFill 1 // Auto-fill wasted space on right (recommended)
  60. #define LVXDI_Blend50Sel 2 // Dither small icon if selected (not recommended)
  61. #define LVXDI_Blend50Dis 4 // Dither small icon if disabled (recommended)
  62. /* 'adwFlags' option bits.
  63. */
  64. #define LVXDIA_3dFace 1 // Column is not editable but other columns are
  65. #define LVXDIA_Static 2 // Emulates static text control w/icon if disabled
  66. /* Returned by owner at draw item time.
  67. */
  68. #define LVXDRAWINFO struct tagLVXDRAWINFO
  69. LVXDRAWINFO
  70. {
  71. /* The number of columns. The list view extensions require that your
  72. ** columns are numbered sequentially from left to right where 0 is the
  73. ** item column and 1 is the first sub-item column. Required always.
  74. */
  75. INT cCols;
  76. /* Pixels to indent this item, or -1 to indent a "small icon" width. Set
  77. ** 0 to disable.
  78. */
  79. INT dxIndent;
  80. /* LVXDI_* options applying to all columns.
  81. */
  82. DWORD dwFlags;
  83. /* LVXDIA_* options applying to individual columns.
  84. */
  85. DWORD adwFlags[ LVX_MaxCols ];
  86. };
  87. typedef LVXDRAWINFO* (*PLVXCALLBACK)( IN HWND, IN DWORD dwItem );
  88. /* Sent by ListView when check changes on an item
  89. */
  90. #define LVXN_SETCHECK (LVN_LAST + 1)
  91. /* Sent by ListView when item is double clicked so properties can be
  92. * raised.
  93. */
  94. #define LVXN_DBLCLK (LVN_LAST + 2)
  95. /* SetOffDesktop actions.
  96. */
  97. #define SOD_MoveOff 1
  98. #define SOD_MoveBackFree 2
  99. #define SOD_MoveBackHidden 3
  100. #define SOD_Free 4
  101. #define SOD_GetOrgRect 5
  102. /*----------------------------------------------------------------------------
  103. ** Prototypes
  104. **----------------------------------------------------------------------------
  105. */
  106. VOID
  107. AddContextHelpButton(
  108. IN HWND hwnd );
  109. VOID
  110. Button_MakeDefault(
  111. IN HWND hwndDlg,
  112. IN HWND hwndPb );
  113. HBITMAP
  114. Button_CreateBitmap(
  115. IN HWND hwndPb,
  116. IN BITMAPSTYLE bitmapstyle );
  117. VOID
  118. CancelOwnedWindows(
  119. IN HWND hwnd );
  120. VOID
  121. CenterWindow(
  122. IN HWND hwnd,
  123. IN HWND hwndRef );
  124. //For whislter bug 320863
  125. //
  126. VOID
  127. CenterExpandWindowRemainLeftMargin(
  128. IN HWND hwnd,
  129. IN HWND hwndRef,
  130. BOOL bHoriz,
  131. BOOL bVert,
  132. IN HWND hwndVertBottomBound);
  133. VOID
  134. CloseOwnedWindows(
  135. IN HWND hwnd );
  136. INT
  137. ComboBox_AddItem(
  138. IN HWND hwndLb,
  139. IN LPCTSTR pszText,
  140. IN VOID* pItem );
  141. INT
  142. ComboBox_AddItemFromId(
  143. IN HINSTANCE hinstance,
  144. IN HWND hwndLb,
  145. IN DWORD dwStringId,
  146. IN VOID* pItem );
  147. INT
  148. ComboBox_AddItemSorted(
  149. IN HWND hwndLb,
  150. IN LPCTSTR pszText,
  151. IN VOID* pItem );
  152. VOID
  153. ComboBox_AutoSizeDroppedWidth(
  154. IN HWND hwndLb );
  155. VOID
  156. ComboBox_FillFromPszList(
  157. IN HWND hwndLb,
  158. IN DTLLIST* pdtllistPsz );
  159. VOID*
  160. ComboBox_GetItemDataPtr(
  161. IN HWND hwndLb,
  162. IN INT nIndex );
  163. TCHAR*
  164. ComboBox_GetPsz(
  165. IN HWND hwnd,
  166. IN INT nIndex );
  167. VOID
  168. ComboBox_SetCurSelNotify(
  169. IN HWND hwndLb,
  170. IN INT nIndex );
  171. TCHAR*
  172. Ellipsisize(
  173. IN HDC hdc,
  174. IN TCHAR* psz,
  175. IN INT dxColumn,
  176. IN INT dxColText OPTIONAL );
  177. VOID
  178. ExpandWindow(
  179. IN HWND hwnd,
  180. IN LONG dx,
  181. IN LONG dy );
  182. TCHAR*
  183. GetText(
  184. IN HWND hwnd );
  185. HWND
  186. HwndFromCursorPos(
  187. IN HINSTANCE hinstance,
  188. IN POINT* ppt OPTIONAL );
  189. LPTSTR
  190. IpGetAddressAsText(
  191. HWND hwndIp );
  192. void
  193. IpSetAddressText(
  194. HWND hwndIp,
  195. LPCTSTR pszIpAddress );
  196. INT
  197. ListBox_AddItem(
  198. IN HWND hwndLb,
  199. IN TCHAR* pszText,
  200. IN VOID* pItem );
  201. TCHAR*
  202. ListBox_GetPsz(
  203. IN HWND hwnd,
  204. IN INT nIndex );
  205. INT
  206. ListBox_IndexFromString(
  207. IN HWND hwnd,
  208. IN TCHAR* psz );
  209. VOID
  210. ListBox_SetCurSelNotify(
  211. IN HWND hwndLb,
  212. IN INT nIndex );
  213. BOOL
  214. ListView_GetCheck(
  215. IN HWND hwndLv,
  216. IN INT iItem );
  217. UINT
  218. ListView_GetCheckedCount(
  219. IN HWND hwndLv );
  220. VOID*
  221. ListView_GetParamPtr(
  222. IN HWND hwndLv,
  223. IN INT iItem );
  224. VOID*
  225. ListView_GetSelectedParamPtr(
  226. IN HWND hwndLv );
  227. VOID
  228. ListView_InsertSingleAutoWidthColumn(
  229. HWND hwndLv );
  230. BOOL
  231. ListView_InstallChecks(
  232. IN HWND hwndLv,
  233. IN HINSTANCE hinst );
  234. BOOL
  235. ListView_OwnerHandler(
  236. IN HWND hwnd,
  237. IN UINT unMsg,
  238. IN WPARAM wparam,
  239. IN LPARAM lparam,
  240. IN PLVXCALLBACK pLvxCallback );
  241. VOID
  242. ListView_SetCheck(
  243. IN HWND hwndLv,
  244. IN INT iItem,
  245. IN BOOL fCheck );
  246. BOOL
  247. ListView_IsCheckDisabled(
  248. IN HWND hwndLv,
  249. IN INT iItem);
  250. VOID
  251. ListView_DisableCheck(
  252. IN HWND hwndLv,
  253. IN INT iItem);
  254. VOID
  255. ListView_EnableCheck(
  256. IN HWND hwndLv,
  257. IN INT iItem);
  258. VOID
  259. ListView_SetDeviceImageList(
  260. IN HWND hwndLv,
  261. IN HINSTANCE hinst );
  262. VOID
  263. ListView_SetUserImageList(
  264. IN HWND hwndLv,
  265. IN HINSTANCE hinst );
  266. VOID
  267. ListView_SetNetworkComponentImageList(
  268. IN HWND hwndLv,
  269. IN HINSTANCE hinst );
  270. BOOL
  271. ListView_SetParamPtr(
  272. IN HWND hwndLv,
  273. IN INT iItem,
  274. IN VOID* pParam );
  275. VOID
  276. ListView_UninstallChecks(
  277. IN HWND hwndLv );
  278. DWORD
  279. LoadRas(
  280. IN HINSTANCE hInst,
  281. IN HWND hwnd );
  282. VOID
  283. Menu_CreateAccelProxies(
  284. IN HINSTANCE hinst,
  285. IN HWND hwndParent,
  286. IN DWORD dwMid );
  287. BOOL
  288. SetEvenTabWidths(
  289. IN HWND hwndDlg,
  290. IN DWORD cPages );
  291. VOID
  292. SlideWindow(
  293. IN HWND hwnd,
  294. IN HWND hwndParent,
  295. IN LONG dx,
  296. IN LONG dy );
  297. VOID
  298. UnclipWindow(
  299. IN HWND hwnd );
  300. BOOL
  301. SetDlgItemNum(
  302. IN HWND hwndDlg,
  303. IN INT iDlgItem,
  304. IN UINT uValue );
  305. VOID
  306. ScreenToClientRect(
  307. IN HWND hwnd,
  308. IN OUT RECT* pRect );
  309. BOOL
  310. SetOffDesktop(
  311. IN HWND hwnd,
  312. IN DWORD dwAction,
  313. OUT RECT* prectOrg );
  314. VOID
  315. UnloadRas(
  316. void );
  317. #endif // _UIUTIL_H_