1
0

statusBar.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #ifndef _NULLSOFT_WINAMP_ML_DEVICES_STATUS_BAR_HEADER
  2. #define _NULLSOFT_WINAMP_ML_DEVICES_STATUS_BAR_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. #define STATUSBAR_WINDOW_CLASS L"NullsoftDevicesStatusBar"
  8. #define STATUS_ERROR ((unsigned int)-1)
  9. HWND
  10. StatusBar_CreateWindow(unsigned long windowExStyle,
  11. const wchar_t *text,
  12. unsigned long windowStyle,
  13. int x,
  14. int y,
  15. int width,
  16. int height,
  17. HWND parentWindow,
  18. unsigned int controlId);
  19. #define STATUSBAR_WM_FIRST (WM_USER + 10)
  20. #define STATUSBAR_WM_SET_BACK_BRUSH (STATUSBAR_WM_FIRST + 0)
  21. #define STATUSBAR_SET_BACK_BRUSH(/*HWND*/ _hwnd, /*HBRSUSH*/ _brush, /*BOOL*/_redraw)\
  22. ((HBRUSH)SendMessageW((_hwnd), STATUSBAR_WM_SET_BACK_BRUSH, (WPARAM)(_redraw), (LPARAM)(_brush)))
  23. #define STATUSBAR_WM_GET_BACK_BRUSH (STATUSBAR_WM_FIRST + 1)
  24. #define STATUSBAR_GET_BRUSH(/*HWND*/ _hwnd)\
  25. ((HBRUSH)SendMessageW((_hwnd), STATUSBAR_WM_GET_BRUSH, 0, 0L))
  26. #define STATUSBAR_WM_SET_BACK_COLOR (STATUSBAR_WM_FIRST + 2)
  27. #define STATUSBAR_SET_BACK_COLOR(/*HWND*/ _hwnd, /*COLORREF*/ _color, /*BOOL*/_redraw)\
  28. ((COLORREF)SendMessageW((_hwnd), STATUSBAR_WM_SET_BACK_COLOR, (WPARAM)(_redraw), (LPARAM)(_color)))
  29. #define STATUSBAR_WM_GET_BACK_COLOR (STATUSBAR_WM_FIRST + 3)
  30. #define STATUSBAR_GET_BACK_COLOR(/*HWND*/ _hwnd)\
  31. ((COLORREF)SendMessageW((_hwnd), STATUSBAR_WM_GET_BACK_COLOR, 0, 0L))
  32. #define STATUSBAR_WM_SET_TEXT_COLOR (STATUSBAR_WM_FIRST + 4)
  33. #define STATUSBAR_SET_TEXT_COLOR(/*HWND*/ _hwnd, /*COLORREF*/ _color, /*BOOL*/_redraw)\
  34. ((COLORREF)SendMessageW((_hwnd), STATUSBAR_WM_SET_TEXT_COLOR, (WPARAM)(_redraw), (LPARAM)(_color)))
  35. #define STATUSBAR_WM_GET_TEXT_COLOR (STATUSBAR_WM_FIRST + 5)
  36. #define STATUSBAR_GET_TEXT_COLOR(/*HWND*/ _hwnd)\
  37. ((COLORREF)SendMessageW((_hwnd), STATUSBAR_WM_GET_TEXT_COLOR, 0, 0L))
  38. #define STATUSBAR_WM_GET_IDEAL_HEIGHT (STATUSBAR_WM_FIRST + 6)
  39. #define STATUSBAR_GET_IDEAL_HEIGHT(/*HWND*/ _hwnd)\
  40. ((int)SendMessageW((_hwnd), STATUSBAR_WM_GET_IDEAL_HEIGHT, 0, 0L))
  41. #define STATUSBAR_WM_ADD_STATUS (STATUSBAR_WM_FIRST + 7)
  42. #define STATUSBAR_ADD_STATUS(/*HWND*/ _hwnd, /*const wchar_t* */ _statusText)\
  43. ((unsigned int)SendMessageW((_hwnd), STATUSBAR_WM_ADD_STATUS, 0, (LPARAM)(_statusText)))
  44. #define STATUSBAR_WM_REMOVE_STATUS (STATUSBAR_WM_FIRST + 8)
  45. #define STATUSBAR_REMOVE_STATUS(/*HWND*/ _hwnd, /*unsigned int*/ _statusId)\
  46. ((BOOL)SendMessageW((_hwnd), STATUSBAR_WM_REMOVE_STATUS, (WPARAM)(_statusId), 0L))
  47. #define STATUSBAR_WM_SET_STATUS_TEXT (STATUSBAR_WM_FIRST + 9)
  48. #define STATUSBAR_SET_STATUS_TEXT(/*HWND*/ _hwnd, /*unsigned int*/ _statusId, /*const wchar_t* */ _statusText)\
  49. ((BOOL)SendMessageW((_hwnd), STATUSBAR_WM_SET_STATUS_TEXT, (WPARAM)(_statusId), (LPARAM)(_statusText)))
  50. #define STATUSBAR_WM_SET_STATUS_RTEXT (STATUSBAR_WM_FIRST + 10)
  51. #define STATUSBAR_SET_STATUS_RTEXT(/*HWND*/ _hwnd, /*unsigned int*/ _statusId, /*const wchar_t* */ _statusText)\
  52. ((BOOL)SendMessageW((_hwnd), STATUSBAR_WM_SET_STATUS_RTEXT, (WPARAM)(_statusId), (LPARAM)(_statusText)))
  53. #define STATUS_MOVE_TOP 0
  54. #define STATUS_MOVE_BOTTOM 1
  55. #define STATUS_MOVE_UP 2
  56. #define STATUS_MOVE_DOWN 3
  57. #define STATUSBAR_WM_MOVE_STATUS (STATUSBAR_WM_FIRST + 11)
  58. #define STATUSBAR_MOVE_STATUS(/*HWND*/ _hwnd, /*unsigned int*/ _statusId, /*unsigned int */ _statusMove)\
  59. ((BOOL)SendMessageW((_hwnd), STATUSBAR_WM_MOVE_STATUS, (WPARAM)(_statusId), (LPARAM)(_statusMove)))
  60. #endif //_NULLSOFT_WINAMP_ML_DEVICES_STATUS_BAR_HEADER