static LRESULT CALLBACK ListViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { struct PickerInfo *pPickerInfo; LRESULT rc = 0; BOOL bHandled = FALSE; WNDPROC pfnParentWndProc; HWND hwndHeaderCtrl = NULL; HFONT hHeaderCtrlFont = NULL; pPickerInfo = GetPickerInfo(hWnd); pfnParentWndProc = pPickerInfo->pfnParentWndProc; switch(message) { case WM_MOUSEMOVE: if (MouseHasBeenMoved()) ShowCursor(TRUE); break; case WM_ERASEBKGND: if (GetBackgroundBitmap()) { rc = ListViewOnErase(hWnd, (HDC) wParam); bHandled = TRUE; } break; case WM_NOTIFY: bHandled = ListViewNotify(hWnd, (LPNMHDR) lParam); break; case WM_SETFONT: hwndHeaderCtrl = ListView_GetHeader(hWnd); if (hwndHeaderCtrl) hHeaderCtrlFont = GetWindowFont(hwndHeaderCtrl); break; case WM_CONTEXTMENU: bHandled = ListViewContextMenu(hWnd, lParam); break; case WM_DESTROY: // Received WM_DESTROY; time to clean up if (pPickerInfo->pCallbacks->pfnSetViewMode) pPickerInfo->pCallbacks->pfnSetViewMode(pPickerInfo->nCurrentViewID); Picker_Free(pPickerInfo); SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR) pfnParentWndProc); SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) NULL); break; } if (!bHandled) rc = CallParentWndProc(pfnParentWndProc, hWnd, message, wParam, lParam); // If we received WM_SETFONT, reset header ctrl font back to original font if (hwndHeaderCtrl) SetWindowFont(hwndHeaderCtrl, hHeaderCtrlFont, TRUE); return rc; }
static LRESULT CALLBACK TabViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { struct TabViewInfo *pTabViewInfo; WNDPROC pfnParentWndProc; BOOL bHandled = FALSE; LRESULT rc = 0; pTabViewInfo = GetTabViewInfo(hWnd); pfnParentWndProc = pTabViewInfo->pfnParentWndProc; switch(message) { case WM_DESTROY: free(pTabViewInfo); SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR) pfnParentWndProc); SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) NULL); break; } if (!bHandled) rc = CallParentWndProc(pfnParentWndProc, hWnd, message, wParam, lParam); switch(message) { case WM_MOVE: case WM_SIZE: if (pTabViewInfo->pCallbacks->pfnOnMoveSize) pTabViewInfo->pCallbacks->pfnOnMoveSize(); break; } return rc; }