Module: wine Branch: master Commit: bbd00da488ee05ace5928b49129ca030cdc7ec0f URL: http://source.winehq.org/git/wine.git/?a=commit;h=bbd00da488ee05ace5928b4912...
Author: Nikolay Sivov bunglehead@gmail.com Date: Wed Apr 29 12:39:17 2009 +0400
comctl32/listview: Handle CCM_[G,S]ETVERSION in listview.
---
dlls/comctl32/listview.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index b6c6c2d..2c60320 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -309,6 +309,8 @@ typedef struct tagLISTVIEW_INFO INT nMeasureItemHeight; INT xTrackLine; /* The x coefficient of the track line or -1 if none */ DELAYED_ITEM_EDIT itemEdit; /* Pointer to this structure will be the timer ID */ + + DWORD iVersion; /* CCM_[G,S]ETVERSION */ } LISTVIEW_INFO;
/* @@ -8133,6 +8135,7 @@ static LRESULT LISTVIEW_NCCreate(HWND hwnd, const CREATESTRUCTW *lpcs) infoPtr->nMeasureItemHeight = 0; infoPtr->xTrackLine = -1; /* no track line */ infoPtr->itemEdit.fEnabled = FALSE; + infoPtr->iVersion = COMCTL32_VERSION;
/* get default font (icon title) */ SystemParametersInfoW(SPI_GETICONTITLELOGFONT, 0, &logFont, 0); @@ -9759,6 +9762,47 @@ static LRESULT LISTVIEW_ShowWindow(LISTVIEW_INFO *infoPtr, BOOL bShown, INT iSta
/*** * DESCRIPTION: + * Processes CCM_GETVERSION messages. + * + * PARAMETER(S): + * [I] infoPtr : valid pointer to the listview structure + * + * RETURN: + * Current version + */ +static inline LRESULT LISTVIEW_GetVersion(LISTVIEW_INFO *infoPtr) +{ + return infoPtr->iVersion; +} + +/*** + * DESCRIPTION: + * Processes CCM_SETVERSION messages. + * + * PARAMETER(S): + * [I] infoPtr : valid pointer to the listview structure + * [I] iVersion : version to be set + * + * RETURN: + * -1 when requested version is greater then DLL version; + * previous version otherwise + */ +static LRESULT LISTVIEW_SetVersion(LISTVIEW_INFO *infoPtr, DWORD iVersion) +{ + INT iOldVersion = infoPtr->iVersion; + + if (iVersion > COMCTL32_VERSION) + return -1; + + infoPtr->iVersion = iVersion; + + TRACE("new version %d\n", iVersion); + + return iOldVersion; +} + +/*** + * DESCRIPTION: * Window procedure of the listview control. * */ @@ -10126,6 +10170,12 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case LVM_UPDATE: return LISTVIEW_Update(infoPtr, (INT)wParam);
+ case CCM_GETVERSION: + return LISTVIEW_GetVersion(infoPtr); + + case CCM_SETVERSION: + return LISTVIEW_SetVersion(infoPtr, wParam); + case WM_CHAR: return LISTVIEW_ProcessLetterKeys( infoPtr, wParam, lParam );