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.

94 lines
2.7 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: peakmetr.h
  6. * Content: Implements a peak meter custom control
  7. *
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 09/22/99 pnewson Created
  12. ***************************************************************************/
  13. #ifndef _PEAKMETR_H_
  14. #define _PEAKMETR_H_
  15. // How to use this custom control
  16. //
  17. // In your code:
  18. // 1) Include peakmetr.h in your project
  19. // 2) Create an instance of the CPeakMeterWndClass class
  20. // 3) Call Register() on that instance to register the window class
  21. // 4) Send the control PM_SETMAX, PM_SETMIN, PM_SETCUR, PM_SETSTEPS
  22. // messages as required.
  23. // 5) When you are no longer using the control, call unregister
  24. // 6) Destroy the CPeakMeterWndClass object
  25. //
  26. // In the dialog editor
  27. // 1) Add a "Custom Control" to your dialog box
  28. // 2) In the properties for that custom control, specify
  29. // "DirectPlayVoicePeakMeter" for the window class
  30. // Peak Meter windows messages:
  31. //
  32. // PM_SETMIN
  33. // wParam = 0;
  34. // lParam = (LPARAM)dwNewMinValue;
  35. //
  36. // Set the new minimum value for the peak meter, i.e. the
  37. // value that represents the bottom of the meter range.
  38. // If this message is not sent, the control defaults to 0.
  39. // The message returns an HRESULT
  40. //
  41. // PM_SETMAX
  42. // wParam = 0;
  43. // lParam = (LPARAM)dwNewMaxValue;
  44. //
  45. // Set the new maximum value for the peak meter, i.e. the
  46. // value that represents the top of the meter range.
  47. // If this message is not sent, the control defaults to 0xffffffff.
  48. // The message returns an HRESULT
  49. //
  50. // PM_SETCUR
  51. // wParam = 0;
  52. // lParam = (LPARAM)dwNewCurValue;
  53. //
  54. // Set the new current value for the peak meter, i.e. the
  55. // value tells the meter where in it's range it should be.
  56. // If this message is not sent, the control defaults to 0.
  57. //
  58. // Sending this message causes the control to call InvalidateRgn
  59. // on its window, but does not call UpdateWindow. This allows
  60. // the caller to be lazy or quick about actually redrawing
  61. // the peak meter.
  62. // The message returns an HRESULT
  63. //
  64. // PM_SETSTEPS
  65. // wParam = 0;
  66. // lParam = (LPARAM)dwNewMaxValue;
  67. //
  68. // Suggest to the peak meter the number of bars it should
  69. // display. The bars have a minimum size, so depending on
  70. // the size of the control, the peak meter may not be able
  71. // to honor the request.
  72. // If this message is not sent, the control defaults to 20
  73. // The message returns an HRESULT
  74. #define PM_SETMAX WM_USER + 1
  75. #define PM_SETMIN WM_USER + 2
  76. #define PM_SETCUR WM_USER + 3
  77. #define PM_SETSTEPS WM_USER + 4
  78. class CPeakMeterWndClass
  79. {
  80. private:
  81. HINSTANCE m_hinst;
  82. public:
  83. HRESULT Register();
  84. HRESULT Unregister();
  85. };
  86. #endif