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.

103 lines
2.1 KiB

  1. //____________________________________________________________________________
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1995 - 1996.
  5. //
  6. // File: uiutil.hxx
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 3/7/1996 RaviR Created
  15. //
  16. //____________________________________________________________________________
  17. #ifndef _UIUTIL_HXX_
  18. #define _UIUTIL_HXX_
  19. #include "..\folderui\util.hxx"
  20. void
  21. SchedUIErrorDialog(
  22. HWND hwnd,
  23. int idsErrMsg,
  24. LONG error,
  25. UINT idsHelpHint = 0);
  26. inline
  27. void
  28. I_SetDlgItemText(
  29. HWND hDlg,
  30. int idCtrl,
  31. LPWSTR pwsz)
  32. {
  33. SetDlgItemText(hDlg, idCtrl, pwsz);
  34. }
  35. inline
  36. UINT
  37. I_GetDlgItemText(
  38. HWND hDlg, // handle of dialog box
  39. int nIDDlgItem, // identifier of control
  40. LPWSTR lpString, // address of buffer for text
  41. int nMaxCount) // maximum size of string
  42. {
  43. return GetDlgItemText(hDlg, nIDDlgItem, lpString, nMaxCount);
  44. }
  45. inline void Spin_SetRange(HWND hDlg, int id, WORD wMin, WORD wMax)
  46. {
  47. SendDlgItemMessage(hDlg, id, UDM_SETRANGE, 0, MAKELONG(wMax, wMin));
  48. }
  49. inline DWORD Spin_GetPos(HWND hDlg, int id)
  50. {
  51. return (DWORD)SendDlgItemMessage(hDlg, id, UDM_GETPOS, 0, 0);
  52. }
  53. inline WORD Spin_SetPos(HWND hDlg, int id, WORD wPos)
  54. {
  55. return (WORD)SendDlgItemMessage(hDlg, id, UDM_SETPOS, 0, MAKELONG(wPos, 0));
  56. }
  57. inline void Spin_Disable(HWND hDlg, int id)
  58. {
  59. HWND hBuddy = (HWND)SendDlgItemMessage(hDlg, id, UDM_GETBUDDY, 0, 0);
  60. SetWindowText(hBuddy, TEXT(""));
  61. EnableWindow(hBuddy, FALSE);
  62. EnableWindow(GetDlgItem(hDlg, id), FALSE);
  63. }
  64. inline void Spin_Enable(HWND hDlg, int id, WORD wPos)
  65. {
  66. HWND hBuddy = (HWND)SendDlgItemMessage(hDlg, id, UDM_GETBUDDY, 0, 0);
  67. EnableWindow(hBuddy, TRUE);
  68. EnableWindow(GetDlgItem(hDlg, id), TRUE);
  69. Spin_SetPos(hDlg, id, wPos);
  70. }
  71. //
  72. // MAX_DP_TIME_FORMAT - should be large enough to hold hh sep mm tt
  73. //
  74. #define MAX_DP_TIME_FORMAT 30
  75. void
  76. UpdateTimeFormat(
  77. LPTSTR tszTimeFormat,
  78. ULONG cchTimeFormat);
  79. #endif // _UIUTIL_HXX_