diff options
Diffstat (limited to 'c/listview.c')
-rw-r--r-- | c/listview.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/c/listview.c b/c/listview.c index 48b61e1..7039e89 100644 --- a/c/listview.c +++ b/c/listview.c @@ -13,14 +13,14 @@ static LRESULT CALLBACK LvProc(HWND, UINT, WPARAM, LPARAM); HWND LvCreate(HMENU hMenu) { - HMODULE hModule; HWND hLv; hLv = CreateWindowEx( WS_EX_CLIENTEDGE, WC_LISTVIEW, TEXT(""), - WS_CHILD|WS_VISIBLE|WS_VSCROLL|LVS_REPORT|LVS_NOSORTHEADER, + WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_TABSTOP + |LVS_REPORT|LVS_NOSORTHEADER, 0, 0, 0, 0, HWnd, hMenu, GetModuleHandle(NULL), NULL ); @@ -33,15 +33,6 @@ LvCreate(HMENU hMenu) SendMessage(hLv, WM_SETFONT, (WPARAM)HfNormal, MAKELPARAM(FALSE, 0)); - hModule = LoadLibrary(TEXT("uxtheme.dll")); - if (hModule && GetProcAddress(hModule, "SetWindowTheme")) { - ListView_SetExtendedListViewStyleEx(hLv, - LVS_EX_DOUBLEBUFFER, LVS_EX_DOUBLEBUFFER); - SendMessage(hLv, WM_CHANGEUISTATE, - MAKEWPARAM(UIS_SET, UISF_HIDEFOCUS), 0); - SetWindowTheme(hLv, TEXT("Explorer"), NULL); - } - return hLv; } @@ -60,3 +51,15 @@ LvProc(HWND hLv, UINT uMsg, WPARAM wParam, LPARAM lParam) return CallWindowProc(LvPrevProc, hLv, uMsg, wParam, lParam); } + +void +LvSetTheme(HWND hLv, int bUseTheme) +{ + ListView_SetExtendedListViewStyleEx(hLv, + LVS_EX_DOUBLEBUFFER, + bUseTheme ? LVS_EX_DOUBLEBUFFER : 0); + SendMessage(hLv, WM_CHANGEUISTATE, + MAKEWPARAM(bUseTheme ? UIS_SET : UIS_CLEAR, + UISF_HIDEFOCUS), 0); + SetWindowTheme(hLv, bUseTheme ? TEXT("Explorer") : NULL, NULL); +} |