driveListBox.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef NULLSOFT_DRIVE_COMBOBOX_HEADER
  2. #define NULLSOFT_DRIVE_COMBOBOX_HEADER
  3. #include "windows.h"
  4. class DriveListBox
  5. {
  6. public:
  7. DriveListBox(int controlId);
  8. ~DriveListBox(void);
  9. public:
  10. void SetColors(COLORREF clrNormalBG, COLORREF clrSelected1, COLORREF clrSelected2, COLORREF clrTextSel, COLORREF clrTextNorm);
  11. void SetImages(HINSTANCE hInstance, int bgndResId, int driveResId);
  12. void Init(HWND hwnd);
  13. int HandleMsgProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
  14. void ReloadImages(void);
  15. HWND GetHWND(void);
  16. private:
  17. void DestroyImages(void);
  18. void CreateBitmaps(HBITMAP bmpBck, HBITMAP bmpDrive);
  19. void DrawItem(LPDRAWITEMSTRUCT di);
  20. int MeasureItem(LPMEASUREITEMSTRUCT mi);
  21. private:
  22. HWND m_hwnd, m_parentHwnd;
  23. HINSTANCE hInstance;
  24. HBITMAP bmpNormal;
  25. HBITMAP bmpSelected;
  26. int driveResId;
  27. int bgndResId;
  28. RECT rcItem;
  29. int controlId;
  30. COLORREF clrNormalBG;
  31. COLORREF clrSelected1;
  32. COLORREF clrSelected2;
  33. COLORREF clrTextSel;
  34. COLORREF clrTextNorm;
  35. };
  36. #endif // NULLSOFT_DRIVE_COMBOBOX_HEADER