diff options
Diffstat (limited to 'c/listview.c')
-rw-r--r-- | c/listview.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/c/listview.c b/c/listview.c index 66bcc29..956e646 100644 --- a/c/listview.c +++ b/c/listview.c @@ -6,18 +6,16 @@ #include "defs.h" extern HFONT g_GUIFont; - -WNDPROC g_PrevLvProc; - +WNDPROC Lv_PrevProc; static LRESULT CALLBACK LvProc(HWND, UINT, WPARAM, LPARAM); HWND LvCreate(HWND hWnd, HMENU hMenu) { HMODULE hModule; - HWND hListView; + HWND hLv; - hListView = CreateWindowEx( + hLv = CreateWindowEx( WS_EX_CLIENTEDGE, WC_LISTVIEW, TEXT(""), @@ -29,40 +27,39 @@ LvCreate(HWND hWnd, HMENU hMenu) NULL ); - g_PrevLvProc = (WNDPROC)SetWindowLongPtr(hListView, + Lv_PrevProc = (WNDPROC)SetWindowLongPtr(hLv, GWLP_WNDPROC, (LONG_PTR)LvProc); - ListView_SetExtendedListViewStyle(hListView, + ListView_SetExtendedListViewStyle(hLv, LVS_EX_DOUBLEBUFFER); - SendMessage(hListView, WM_SETFONT, + SendMessage(hLv, WM_SETFONT, (WPARAM)g_GUIFont, MAKELPARAM(FALSE, 0)); hModule = LoadLibrary(TEXT("uxtheme.dll")); if (hModule && GetProcAddress(hModule, "SetWindowTheme")) { - ListView_SetExtendedListViewStyle(hListView, + ListView_SetExtendedListViewStyle(hLv, LVS_EX_FULLROWSELECT|LVS_EX_DOUBLEBUFFER); - SendMessage(hListView, WM_CHANGEUISTATE, + SendMessage(hLv, WM_CHANGEUISTATE, MAKEWPARAM(UIS_SET, UISF_HIDEFOCUS), 0); - SetWindowTheme(hListView, TEXT("Explorer"), NULL); + SetWindowTheme(hLv, TEXT("Explorer"), NULL); } - return hListView; + return hLv; } LRESULT CALLBACK -LvProc(HWND hListView, UINT uMsg, WPARAM wParam, LPARAM lParam) +LvProc(HWND hLv, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_NOTIFY: switch (((NMHDR *)lParam)->code) { case HDN_ENDTRACK: - UpdateLayout(GetParent(hListView)); + UpdateLayout(GetParent(hLv)); return TRUE; } break; } - return CallWindowProc(g_PrevLvProc, - hListView, uMsg, wParam, lParam); + return CallWindowProc(Lv_PrevProc, hLv, uMsg, wParam, lParam); } |