diff options
Diffstat (limited to 'c/listview.cpp')
-rw-r--r-- | c/listview.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/c/listview.cpp b/c/listview.cpp index 41f68a7..6074707 100644 --- a/c/listview.cpp +++ b/c/listview.cpp @@ -3,24 +3,24 @@ #include "listview.h" #include "layout.h" +#include "main.h" #include "win.h" /* Actual window procedure for all list views, which calls the * appropriate WndProc member function. */ static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); -ListView::ListView(const HWND hWndParent, const HMENU hMenu, const DWORD dwStyle) +ListView::ListView(Window& parent, const HMENU hMenu, const DWORD dwStyle) : parent(parent) { extern HFONT g_hfNormal; - m_hWndParent = hWndParent; hWnd = Require(CreateWindowExW( WS_EX_CLIENTEDGE, WC_LISTVIEW, L"", dwStyle|WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_TABSTOP|LVS_REPORT|LVS_SHOWSELALWAYS, 0, 0, 0, 0, - hWndParent, hMenu, GetModuleHandle(nullptr), this)); + parent.hWnd, hMenu, GetModuleHandle(nullptr), this)); m_proc0 = reinterpret_cast<WNDPROC>(SetWindowLongPtr( hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(::WndProc))); @@ -41,7 +41,7 @@ void ListView::UpdateTheme(const bool bThemeActive) { const wchar_t* theme; WORD action; - extern BOOL (*SetWindowTheme)(HWND, const wchar_t*, const wchar_t*); + extern HRESULT (__stdcall *SetWindowTheme)(HWND, const wchar_t*, const wchar_t*); if (!SetWindowTheme) return; if (bThemeActive) { @@ -62,7 +62,6 @@ void ListView::UpdateTheme(const bool bThemeActive) LRESULT CALLBACK ListView::WndProc(const HWND hWnd, const UINT uMsg, const WPARAM wParam, const LPARAM lParam) { - extern DlvDragger g_dragDlv; switch (uMsg) { case WM_NOTIFY: switch (reinterpret_cast<NMHDR*>(lParam)->code) { @@ -73,7 +72,7 @@ LRESULT CALLBACK ListView::WndProc(const HWND hWnd, const UINT uMsg, break; case WM_LBUTTONDOWN: case WM_NCLBUTTONDOWN: - if (g_dragDlv.HandleLButtonDown()) + if (parent.dragDlv.HandleLButtonDown()) return 0; break; } |