From e1906e8f45b732d83aca0935c59852c7aa64def9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 17 Jul 2022 18:07:40 +0200 Subject: Make ListView hWnd public. A getter offers encapsulation, but it is also less transparent in a sense. Thinking of ListView as a struct, it is natural to expose hWnd as a public member variable. --- c/datalistview.cpp | 14 ++++---- c/episodelistview.cpp | 98 +++++++++++++++++++++++++-------------------------- c/episodelistview.h | 1 - c/listview.cpp | 23 +++++------- c/listview.h | 4 +-- c/main.cpp | 40 ++++++++++----------- 6 files changed, 87 insertions(+), 93 deletions(-) diff --git a/c/datalistview.cpp b/c/datalistview.cpp index 6262c41..c83c65f 100644 --- a/c/datalistview.cpp +++ b/c/datalistview.cpp @@ -23,17 +23,17 @@ DataListView::DataListView(const HWND hWndParent) lvc.pszText = TEXT("Key"); lvc.cx = Dpi(42); - ListView_InsertColumn(m_hWnd, DLVSIKEY, &lvc); + ListView_InsertColumn(hWnd, DLVSIKEY, &lvc); lvc.iSubItem = DLVSIVALUE; lvc.pszText = TEXT("Value"); lvc.cx = 500; - ListView_InsertColumn(m_hWnd, DLVSIVALUE, &lvc); + ListView_InsertColumn(hWnd, DLVSIVALUE, &lvc); } void DataListView::ShowEpisode(const int iEpisode) { - ListView_DeleteAllItems(m_hWnd); + ListView_DeleteAllItems(hWnd); LVITEM lviKey, lviValue; lviKey.mask = LVIF_TEXT; @@ -55,12 +55,12 @@ void DataListView::ShowEpisode(const int iEpisode) lviKey.iItem = i; lviKey.iSubItem = 0; lviKey.pszText = tszKey; - ListView_InsertItem(m_hWnd, &lviKey); + ListView_InsertItem(hWnd, &lviKey); lviValue.iItem = i; lviValue.iSubItem = 1; lviValue.pszText = tszValue; - ListView_SetItem(m_hWnd, &lviValue); + ListView_SetItem(hWnd, &lviValue); } PL_cut_query(q); @@ -69,7 +69,7 @@ void DataListView::ShowEpisode(const int iEpisode) LVFINDINFO lvfi; lvfi.flags = LVFI_PARAM; lvfi.lParam = iEpisode; - int iItem = ListView_FindItem(g_pElv->Handle(), -1, &lvfi); + int iItem = ListView_FindItem(g_pElv->hWnd, -1, &lvfi); if (iItem != -1) - ListView_EnsureVisible(g_pElv->Handle(), iItem, TRUE); + ListView_EnsureVisible(g_pElv->hWnd, iItem, TRUE); } diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp index 706c51a..a24c831 100644 --- a/c/episodelistview.cpp +++ b/c/episodelistview.cpp @@ -22,17 +22,17 @@ EpisodeListView::EpisodeListView(const HWND hWndParent) lvc.iSubItem = ELVSIEPISODE; lvc.pszText = TEXT("#"); lvc.cx = Dpi(42); - ListView_InsertColumn(m_hWnd, ELVSIEPISODE, &lvc); + ListView_InsertColumn(hWnd, ELVSIEPISODE, &lvc); lvc.iSubItem = ELVSITITLE; lvc.pszText = TEXT("Title"); lvc.cx = 500; - ListView_InsertColumn(m_hWnd, ELVSITITLE, &lvc); + ListView_InsertColumn(hWnd, ELVSITITLE, &lvc); lvc.iSubItem = ELVSIRATING; lvc.pszText = TEXT("/"); lvc.cx = Dpi(30); - ListView_InsertColumn(m_hWnd, ELVSIRATING, &lvc); + ListView_InsertColumn(hWnd, ELVSIRATING, &lvc); if (!Pl("cfg","get_sort",&m_iSort)) m_iSort = 1; @@ -40,14 +40,14 @@ EpisodeListView::EpisodeListView(const HWND hWndParent) void EpisodeListView::DoSort() { - ListView_SortItemsEx(m_hWnd, ElvSort, (LPARAM)this); + ListView_SortItemsEx(hWnd, ElvSort, (LPARAM)this); } void EpisodeListView::EnsureFocusVisible() { - const int iEpFocus = ListView_GetNextItem(m_hWnd, -1, LVNI_FOCUSED); + const int iEpFocus = ListView_GetNextItem(hWnd, -1, LVNI_FOCUSED); if (iEpFocus == -1) return; - ListView_EnsureVisible(m_hWnd, iEpFocus, TRUE); + ListView_EnsureVisible(hWnd, iEpFocus, TRUE); } LRESULT EpisodeListView::HandleNotify(const LPARAM lParam) @@ -119,8 +119,8 @@ LRESULT EpisodeListView::HandleNotify(const LPARAM lParam) lvi.mask = LVIF_PARAM; lvi.iItem = -1; while ((lvi.iItem = ListView_GetNextItem( - m_hWnd, lvi.iItem, LVNI_SELECTED)) != -1) { - if (!ListView_GetItem(m_hWnd, &lvi)) goto b; + hWnd, lvi.iItem, LVNI_SELECTED)) != -1) { + if (!ListView_GetItem(hWnd, &lvi)) goto b; if (!Pl("local_episodes","open_episode_locally", lvi.lParam)) Pl("local_episodes","open_episode_online", @@ -144,7 +144,7 @@ LRESULT EpisodeListView::HandleNotify(const LPARAM lParam) void EpisodeListView::Redraw() { - RedrawWindow(m_hWnd, NULL, NULL, + RedrawWindow(hWnd, NULL, NULL, RDW_ERASE|RDW_FRAME|RDW_INVALIDATE|RDW_ALLCHILDREN); } @@ -152,16 +152,16 @@ void EpisodeListView::SaveFocus() { LVITEM lvi; lvi.mask = LVIF_PARAM; - if ((lvi.iItem = ListView_GetNextItem(m_hWnd, -1, LVNI_FOCUSED)) != -1 - && ListView_GetItem(m_hWnd, &lvi)) + if ((lvi.iItem = ListView_GetNextItem(hWnd, -1, LVNI_FOCUSED)) != -1 + && ListView_GetItem(hWnd, &lvi)) Pl("cfg","set_focus",lvi.lParam); } void EpisodeListView::SetTop(const int iItem) { - const int iLast = ListView_GetItemCount(m_hWnd)-1; - ListView_EnsureVisible(m_hWnd, iLast, TRUE); - ListView_EnsureVisible(m_hWnd, iItem, TRUE); + const int iLast = ListView_GetItemCount(hWnd)-1; + ListView_EnsureVisible(hWnd, iLast, TRUE); + ListView_EnsureVisible(hWnd, iItem, TRUE); } /* Select previously focused episode. */ @@ -176,21 +176,21 @@ void EpisodeListView::RestoreFocus() lvfi.flags = LVFI_PARAM; lvfi.lParam = iEpisode; i = 0; - while ((iItem = ListView_FindItem(m_hWnd, -1, &lvfi)) == -1 && i++ < 100) + while ((iItem = ListView_FindItem(hWnd, -1, &lvfi)) == -1 && i++ < 100) lvfi.lParam = ++iEpisode; if (iItem != -1) goto s; iEpisode -= 100; lvfi.lParam = iEpisode; i = 0; - while ((iItem = ListView_FindItem(m_hWnd, -1, &lvfi)) == -1 && i++ < 100) + while ((iItem = ListView_FindItem(hWnd, -1, &lvfi)) == -1 && i++ < 100) lvfi.lParam = --iEpisode; if (iItem != -1) goto s; return; -s: ListView_SetItemState(m_hWnd, -1, LVIF_STATE, LVIS_SELECTED); +s: ListView_SetItemState(hWnd, -1, LVIF_STATE, LVIS_SELECTED); SetTop(iItem > 5? iItem-5: 0); - ListView_SetItemState(m_hWnd, iItem, + ListView_SetItemState(hWnd, iItem, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED); m_lviFocus.iItem = iItem; m_lviFocus.lParam = iEpisode; @@ -204,8 +204,8 @@ void EpisodeListView::SelectUnwatched(int iDir) /* Get focused episode. */ LVITEM lviFocus; lviFocus.mask = LVIF_PARAM; - if ((lviFocus.iItem = ListView_GetNextItem(m_hWnd, -1, LVNI_FOCUSED)) != -1 - && ListView_GetItem(m_hWnd, &lviFocus)) + if ((lviFocus.iItem = ListView_GetNextItem(hWnd, -1, LVNI_FOCUSED)) != -1 + && ListView_GetItem(hWnd, &lviFocus)) ; else return; @@ -222,14 +222,14 @@ void EpisodeListView::SelectUnwatched(int iDir) return; lvfi.lParam = iEpNew; - if ((iItemNew = ListView_FindItem(m_hWnd, -1, &lvfi)) != -1) { - ListView_SetItemState(m_hWnd,-1,LVIF_STATE,LVIS_SELECTED); - ListView_SetSelectionMark(m_hWnd, iItemNew); - ListView_SetItemState(m_hWnd, iItemNew, + if ((iItemNew = ListView_FindItem(hWnd, -1, &lvfi)) != -1) { + ListView_SetItemState(hWnd,-1,LVIF_STATE,LVIS_SELECTED); + ListView_SetSelectionMark(hWnd, iItemNew); + ListView_SetItemState(hWnd, iItemNew, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED); Redraw(); - ListView_EnsureVisible(m_hWnd, iItemNew, TRUE); + ListView_EnsureVisible(hWnd, iItemNew, TRUE); return; } } while (i++ < 1000); @@ -237,9 +237,9 @@ void EpisodeListView::SelectUnwatched(int iDir) void EpisodeListView::ShowFocus() { - const int iEpFocus = ListView_GetNextItem(m_hWnd, -1, LVNI_FOCUSED); + const int iEpFocus = ListView_GetNextItem(hWnd, -1, LVNI_FOCUSED); if (iEpFocus == -1) return; - ListView_EnsureVisible(m_hWnd, iEpFocus, TRUE); + ListView_EnsureVisible(hWnd, iEpFocus, TRUE); } /* Update episode list. */ @@ -255,30 +255,30 @@ void EpisodeListView::Update() lviEpisode.mask = LVIF_TEXT|LVIF_PARAM; /* Save scrolling position. */ - lviTop.iItem = ListView_GetTopIndex(m_hWnd); + lviTop.iItem = ListView_GetTopIndex(hWnd); lviTop.mask = LVIF_PARAM; - ListView_GetItem(m_hWnd, &lviTop); + ListView_GetItem(hWnd, &lviTop); /* Save selected episodes. */ i = 0; lvi.mask = LVIF_PARAM; lvi.iItem = -1; while ((lvi.iItem = ListView_GetNextItem( - m_hWnd, lvi.iItem, LVNI_SELECTED)) != -1 + hWnd, lvi.iItem, LVNI_SELECTED)) != -1 && i < 2048) - if (ListView_GetItem(m_hWnd, &lvi)) + if (ListView_GetItem(hWnd, &lvi)) aEpSel[i++] = lvi.lParam; aEpSel[i] = 0; - iItemMark = ListView_GetSelectionMark(m_hWnd); + iItemMark = ListView_GetSelectionMark(hWnd); /* Save focus. */ iEpFocus = 0; - if ((lvi.iItem = ListView_GetNextItem(m_hWnd, -1, LVNI_FOCUSED)) != -1 - && ListView_GetItem(m_hWnd, &lvi)) + if ((lvi.iItem = ListView_GetNextItem(hWnd, -1, LVNI_FOCUSED)) != -1 + && ListView_GetItem(hWnd, &lvi)) iEpFocus = lvi.lParam; - SendMessage(m_hWnd, WM_SETREDRAW, FALSE, 0); - ListView_DeleteAllItems(m_hWnd); + SendMessage(hWnd, WM_SETREDRAW, FALSE, 0); + ListView_DeleteAllItems(hWnd); if (!Pl("episode_data","ensure_episode_data")) return; if (!Pl("episode_data","episode_count",&cEp)) return; @@ -305,7 +305,7 @@ void EpisodeListView::Update() lviEpisode.iSubItem = ELVSIEPISODE; lviEpisode.pszText = tszEpisode; lviEpisode.lParam = iEp; - ListView_InsertItem(m_hWnd, &lviEpisode); + ListView_InsertItem(hWnd, &lviEpisode); UpdateItem(&lviEpisode); } @@ -317,12 +317,12 @@ void EpisodeListView::Update() for (i = 0; aEpSel[i]; i++) { int iItemSel; lvfi.lParam = aEpSel[i]; - if ((iItemSel = ListView_FindItem(m_hWnd, -1, &lvfi)) != -1) - ListView_SetItemState(m_hWnd, iItemSel, + if ((iItemSel = ListView_FindItem(hWnd, -1, &lvfi)) != -1) + ListView_SetItemState(hWnd, iItemSel, LVIS_SELECTED, LVIS_SELECTED); } if (iItemMark != -1) - ListView_SetSelectionMark(m_hWnd, iItemMark); + ListView_SetSelectionMark(hWnd, iItemMark); /* Reset focus. */ if (iEpFocus) { @@ -330,10 +330,10 @@ void EpisodeListView::Update() i = 0; do lvfi.lParam = iEpFocus+i; - while ((iItemFocus = ListView_FindItem(m_hWnd, -1, &lvfi)) == -1 + while ((iItemFocus = ListView_FindItem(hWnd, -1, &lvfi)) == -1 && i++ < 100); if (iItemFocus != -1) - ListView_SetItemState(m_hWnd, iItemFocus, + ListView_SetItemState(hWnd, iItemFocus, LVIS_FOCUSED, LVIS_FOCUSED); } @@ -342,14 +342,14 @@ void EpisodeListView::Update() i = 0; do lvfi.lParam = lviTop.lParam+i; - while ((iItemTopNew = ListView_FindItem(m_hWnd, -1, &lvfi)) == -1 + while ((iItemTopNew = ListView_FindItem(hWnd, -1, &lvfi)) == -1 && i++ < 100); if (iItemTopNew != -1) SetTop(iItemTopNew); _stprintf_s(tszDisp, sizeof(tszDisp), TEXT("%d"), iItem); SendMessage(g_hWndStatus, SB_SETTEXT, MAKEWPARAM(1,0), (LPARAM)tszDisp); - SendMessage(m_hWnd, WM_SETREDRAW, TRUE, 0); + SendMessage(hWnd, WM_SETREDRAW, TRUE, 0); } /* Update episode name and rating. */ @@ -364,15 +364,15 @@ void EpisodeListView::UpdateItem(const LVITEM* const pLvi) if (!Pl("episode_data","episode_title",pLvi->lParam,&tszName)) goto r; } - ListView_SetItemText(m_hWnd, pLvi->iItem, ELVSITITLE, tszName); + ListView_SetItemText(hWnd, pLvi->iItem, ELVSITITLE, tszName); r: if (!Pl("episode_data","episode_rating",pLvi->lParam,&iRating)) { - ListView_SetItemText(m_hWnd, pLvi->iItem, ELVSIRATING, TEXT("")); + ListView_SetItemText(hWnd, pLvi->iItem, ELVSIRATING, TEXT("")); return; } _stprintf_s(tszRating, sizeof(tszRating), TEXT("%d"), iRating); - ListView_SetItemText(m_hWnd, pLvi->iItem, ELVSIRATING, tszRating); + ListView_SetItemText(hWnd, pLvi->iItem, ELVSIRATING, tszRating); } LRESULT CALLBACK EpisodeListView::WndProc(const HWND hWnd, const UINT uMsg, @@ -404,8 +404,8 @@ int CALLBACK ElvSort(const LPARAM iItem1, const LPARAM iItem2, const LPARAM lExt LVITEM lvi1, lvi2; lvi1.mask = lvi2.mask = LVIF_PARAM; lvi1.iItem = iItem1; lvi2.iItem = iItem2; - if (!ListView_GetItem(pElv->Handle(), &lvi1)) return 0; - if (!ListView_GetItem(pElv->Handle(), &lvi2)) return 0; + if (!ListView_GetItem(pElv->hWnd, &lvi1)) return 0; + if (!ListView_GetItem(pElv->hWnd, &lvi2)) return 0; /* abs(m_iSort) is the 1-based index of the column to sort by. * If m_iSort is negative, the order is descending. */ diff --git a/c/episodelistview.h b/c/episodelistview.h index 960f5a5..7061944 100644 --- a/c/episodelistview.h +++ b/c/episodelistview.h @@ -16,7 +16,6 @@ struct EpisodeListView : public ListView void DoSort(void); void EnsureFocusVisible(void); LRESULT HandleNotify(LPARAM lParam); - int ISort(void) const; void Redraw(void); void SaveFocus(void); void SetTop(int iItem); diff --git a/c/listview.cpp b/c/listview.cpp index f70abe5..6c0185d 100644 --- a/c/listview.cpp +++ b/c/listview.cpp @@ -13,7 +13,7 @@ ListView::ListView(const HWND hWndParent, const HMENU hMenu, const DWORD dwStyle { m_hWndParent = hWndParent; m_bHeader = !(dwStyle & LVS_NOCOLUMNHEADER); - m_hWnd = CreateWindowEx( + hWnd = CreateWindowEx( WS_EX_CLIENTEDGE, WC_LISTVIEW, TEXT(""), @@ -21,12 +21,12 @@ ListView::ListView(const HWND hWndParent, const HMENU hMenu, const DWORD dwStyle 0, 0, 0, 0, m_hWndParent, hMenu, GetModuleHandle(NULL), this ); - if (SetProp(m_hWnd, TEXT("this"), (HANDLE)this)) - m_prevProc = (WNDPROC)SetWindowLongPtr(m_hWnd, + if (SetProp(hWnd, TEXT("this"), (HANDLE)this)) + m_prevProc = (WNDPROC)SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)::WndProc); - ListView_SetExtendedListViewStyle(m_hWnd, LVS_EX_FULLROWSELECT); - SendMessage(m_hWnd, WM_SETFONT, (WPARAM)g_hfNormal, MAKELPARAM(FALSE, 0)); + ListView_SetExtendedListViewStyle(hWnd, LVS_EX_FULLROWSELECT); + SendMessage(hWnd, WM_SETFONT, (WPARAM)g_hfNormal, MAKELPARAM(FALSE, 0)); } /* Naively calculate height of list view. */ @@ -34,15 +34,10 @@ int ListView::Height(int bHeader) { if (bHeader == -1) bHeader = m_bHeader; - const int iCount = ListView_GetItemCount(m_hWnd); + const int iCount = ListView_GetItemCount(hWnd); return iCount? Dpi(bHeader? 27: 4)+iCount*Dpi(19): 0; } -HWND ListView::Handle() const -{ - return m_hWnd; -} - void ListView::UpdateTheme(const BOOL bThemeActive) { DWORD dwStyle; @@ -62,13 +57,13 @@ void ListView::UpdateTheme(const BOOL bThemeActive) } /* Use modern "Explorer" theme. */ - SetWindowTheme(m_hWnd, tszTheme, NULL); + SetWindowTheme(hWnd, tszTheme, NULL); /* The modern theme requires double buffering. */ - ListView_SetExtendedListViewStyleEx(m_hWnd, LVS_EX_DOUBLEBUFFER, dwStyle); + ListView_SetExtendedListViewStyleEx(hWnd, LVS_EX_DOUBLEBUFFER, dwStyle); /* Hide focus rectangles. */ - SendMessage(m_hWnd, WM_UPDATEUISTATE, MAKEWPARAM(wAction, UISF_HIDEFOCUS), 0); + SendMessage(hWnd, WM_UPDATEUISTATE, MAKEWPARAM(wAction, UISF_HIDEFOCUS), 0); } LRESULT CALLBACK ListView::WndProc(const HWND hWnd, const UINT uMsg, diff --git a/c/listview.h b/c/listview.h index 41b7613..31ecc79 100644 --- a/c/listview.h +++ b/c/listview.h @@ -5,15 +5,15 @@ struct ListView { + HWND hWnd; + ListView(HWND hWndParent, HMENU hMenu, DWORD dwStyle); int Height(int bHeader = -1); - HWND Handle(void) const; virtual void UpdateTheme(BOOL bThemeActive); virtual LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); protected: int m_bHeader = 1; WNDPROC m_prevProc; - HWND m_hWnd; HWND m_hWndParent; }; diff --git a/c/main.cpp b/c/main.cpp index 1950295..ddfd490 100644 --- a/c/main.cpp +++ b/c/main.cpp @@ -181,7 +181,7 @@ LRESULT CALLBACK WndProc(const HWND hWnd, const UINT uMsg, const WPARAM wParam, { UpdateTheme(); SetWindowPos(hWnd, NULL, -1, -1, Dpi(510), Dpi(400), SWP_NOMOVE); - SetFocus(g_pElv->Handle()); + SetFocus(g_pElv->hWnd); /* Set menu item checkmarks according to saved settings. */ CheckMenuItem(GetMenu(hWnd), IDM_VIEW_WATCHED, @@ -317,13 +317,13 @@ LRESULT CALLBACK WndProc(const HWND hWnd, const UINT uMsg, const WPARAM wParam, MF_CHECKED); g_szLimitScreenwriter[0] = 0; } else { - const int iEpFocus = ListView_GetNextItem(g_pElv->Handle(), -1, LVNI_FOCUSED); + const int iEpFocus = ListView_GetNextItem(g_pElv->hWnd, -1, LVNI_FOCUSED); if (iEpFocus == -1) break; LVITEM lvi; lvi.iItem = iEpFocus; lvi.mask = LVIF_PARAM; - if (!ListView_GetItem(g_pElv->Handle(), &lvi)) break; + if (!ListView_GetItem(g_pElv->hWnd, &lvi)) break; char* sz; if (!Pl("episode_data","episode_datum",lvi.lParam,"Screenwriter",&sz)) @@ -364,8 +364,8 @@ LRESULT CALLBACK WndProc(const HWND hWnd, const UINT uMsg, const WPARAM wParam, lvi.mask = LVIF_PARAM; lvi.iItem = -1; while ((lvi.iItem = ListView_GetNextItem( - g_pElv->Handle(), lvi.iItem, LVNI_SELECTED)) != -1) { - if (!ListView_GetItem(g_pElv->Handle(), &lvi)) goto b; + g_pElv->hWnd, lvi.iItem, LVNI_SELECTED)) != -1) { + if (!ListView_GetItem(g_pElv->hWnd, &lvi)) goto b; switch (LOWORD(wParam)) { case IDM_WATCH_LOCALLY: @@ -503,24 +503,24 @@ void UpdateLayout() yStatus = rcStatus.bottom-rcStatus.top; /* Resize data list view. */ - SendMessage(g_pDlv->Handle(), WM_SETREDRAW, FALSE, 0); - SendMessage(g_pElv->Handle(), WM_SETREDRAW, FALSE, 0); + SendMessage(g_pDlv->hWnd, WM_SETREDRAW, FALSE, 0); + SendMessage(g_pElv->hWnd, WM_SETREDRAW, FALSE, 0); cyDlv = rc.bottom-yStatus-g_pDlv->Height(); - MoveWindow(g_pDlv->Handle(), 0, cyDlv, rc.right, rc.bottom-yStatus-cyDlv, TRUE); - ListView_SetColumnWidth(g_pDlv->Handle(), DLVSIKEY, LVSCW_AUTOSIZE); - cxColumn = ListView_GetColumnWidth(g_pDlv->Handle(), 0)+4; - ListView_SetColumnWidth(g_pDlv->Handle(), DLVSIKEY, cxColumn); - ListView_SetColumnWidth(g_pDlv->Handle(), DLVSIVALUE, rc.right-cxColumn-g_cxVScroll-4); + MoveWindow(g_pDlv->hWnd, 0, cyDlv, rc.right, rc.bottom-yStatus-cyDlv, TRUE); + ListView_SetColumnWidth(g_pDlv->hWnd, DLVSIKEY, LVSCW_AUTOSIZE); + cxColumn = ListView_GetColumnWidth(g_pDlv->hWnd, 0)+4; + ListView_SetColumnWidth(g_pDlv->hWnd, DLVSIKEY, cxColumn); + ListView_SetColumnWidth(g_pDlv->hWnd, DLVSIVALUE, rc.right-cxColumn-g_cxVScroll-4); /* Resize episode list view. */ - MoveWindow(g_pElv->Handle(), 0, 0, rc.right, cyDlv+1, TRUE); - ListView_SetColumnWidth(g_pElv->Handle(), ELVSIEPISODE, LVSCW_AUTOSIZE); - cxColumn = ListView_GetColumnWidth(g_pElv->Handle(), ELVSIEPISODE)+4; - ListView_SetColumnWidth(g_pElv->Handle(), ELVSIEPISODE, cxColumn); - cxColumn += ListView_GetColumnWidth(g_pElv->Handle(), ELVSIRATING); - ListView_SetColumnWidth(g_pElv->Handle(), ELVSITITLE, rc.right-cxColumn-g_cxVScroll-4); - SendMessage(g_pElv->Handle(), WM_SETREDRAW, TRUE, 0); - SendMessage(g_pDlv->Handle(), WM_SETREDRAW, TRUE, 0); + MoveWindow(g_pElv->hWnd, 0, 0, rc.right, cyDlv+1, TRUE); + ListView_SetColumnWidth(g_pElv->hWnd, ELVSIEPISODE, LVSCW_AUTOSIZE); + cxColumn = ListView_GetColumnWidth(g_pElv->hWnd, ELVSIEPISODE)+4; + ListView_SetColumnWidth(g_pElv->hWnd, ELVSIEPISODE, cxColumn); + cxColumn += ListView_GetColumnWidth(g_pElv->hWnd, ELVSIRATING); + ListView_SetColumnWidth(g_pElv->hWnd, ELVSITITLE, rc.right-cxColumn-g_cxVScroll-4); + SendMessage(g_pElv->hWnd, WM_SETREDRAW, TRUE, 0); + SendMessage(g_pDlv->hWnd, WM_SETREDRAW, TRUE, 0); /* Resize status bar parts. */ const int aParts[] = {rc.right-Dpi(55), rc.right}; -- cgit v1.2.3