#ifndef LISTVIEW_H #define LISTVIEW_H #include #include struct ListView { HWND hWnd; ListView(HWND hWndParent, HMENU hMenu, DWORD dwStyle); /* Retrieve next matching list view item. */ bool FindNextItem(LVITEM* lvi, LPARAM lParam); /* Naively calculate height appropriate for number of items. */ virtual int Height(); /* Update column widths on window size change (unimplemented * by default). */ virtual void ResizeColumns(int w); /* Enable/disable "modern" theme. */ virtual void UpdateTheme(bool bThemeActive); virtual LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); protected: WNDPROC m_proc0; HWND m_hWndParent; }; inline bool ListView::FindNextItem(LVITEM* const lvi, const LPARAM lParam) { if ((lvi->iItem = ListView_GetNextItem(hWnd, lvi->iItem, lParam)) == -1) return false; return ListView_GetItem(hWnd, lvi); } #endif