aboutsummaryrefslogtreecommitdiff
path: root/c/listview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c/listview.cpp')
-rw-r--r--c/listview.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/c/listview.cpp b/c/listview.cpp
index 82c6df6..0392941 100644
--- a/c/listview.cpp
+++ b/c/listview.cpp
@@ -20,12 +20,13 @@ ListView::ListView(const HWND hWndParent, const HMENU hMenu, const DWORD dwStyle
L"",
dwStyle|WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_TABSTOP|LVS_REPORT|LVS_SHOWSELALWAYS,
0, 0, 0, 0,
- hWndParent, hMenu, GetModuleHandle(NULL), this));
- m_proc0 = (WNDPROC)SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)::WndProc);
+ hWndParent, hMenu, GetModuleHandle(nullptr), this));
+ m_proc0 = reinterpret_cast<WNDPROC>(SetWindowLongPtr(
+ hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(::WndProc)));
- Require(SetProp(hWnd, L"this", (HANDLE)this));
+ Require(SetProp(hWnd, L"this", reinterpret_cast<HANDLE>(this)));
ListView_SetExtendedListViewStyle(hWnd, LVS_EX_FULLROWSELECT|LVS_EX_DOUBLEBUFFER);
- SendMessage(hWnd, WM_SETFONT, (WPARAM)g_hfNormal, MAKELPARAM(FALSE, 0));
+ SendMessage(hWnd, WM_SETFONT, reinterpret_cast<WPARAM>(g_hfNormal), MAKELPARAM(FALSE, 0));
}
int ListView::Height()
@@ -47,12 +48,12 @@ void ListView::UpdateTheme(const BOOL bThemeActive)
theme = L"Explorer";
action = UIS_SET;
} else {
- theme = NULL;
+ theme = nullptr;
action = UIS_CLEAR;
}
/* Use modern "Explorer" theme. */
- SetWindowTheme(hWnd, theme, NULL);
+ SetWindowTheme(hWnd, theme, nullptr);
/* Hide focus rectangles. */
SendMessage(hWnd, WM_UPDATEUISTATE, MAKEWPARAM(action, UISF_HIDEFOCUS), 0);
@@ -64,7 +65,7 @@ LRESULT CALLBACK ListView::WndProc(const HWND hWnd, const UINT uMsg,
extern DlvDragger g_dragDlv;
switch (uMsg) {
case WM_NOTIFY:
- switch (((NMHDR*)lParam)->code) {
+ switch (reinterpret_cast<NMHDR*>(lParam)->code) {
case HDN_ENDTRACK:
UpdateLayout();
return TRUE;
@@ -83,7 +84,7 @@ LRESULT CALLBACK ListView::WndProc(const HWND hWnd, const UINT uMsg,
LRESULT CALLBACK WndProc(const HWND hWnd, const UINT uMsg, const WPARAM wParam,
const LPARAM lParam)
{
- ListView* const lv = (ListView*)GetProp(hWnd, L"this");
+ ListView* const lv = reinterpret_cast<ListView*>(GetProp(hWnd, L"this"));
if (uMsg == WM_DESTROY)
RemoveProp(hWnd, L"this");