From 70e0969eebb99c66c05e48c4401f0feaf7c757c8 Mon Sep 17 00:00:00 2001
From: Eric Kohl <ekohl@abo.rhein-zeitung.de>
Date: Tue, 23 Nov 1999 23:38:22 +0000
Subject: [PATCH] - added version messages

---
 dlls/comctl32/rebar.c | 30 ++++++++++++++++++++++++++++++
 include/rebar.h       |  1 +
 2 files changed, 31 insertions(+)

diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c
index 3bf29a8b647..5f3d0fad9b9 100644
--- a/dlls/comctl32/rebar.c
+++ b/dlls/comctl32/rebar.c
@@ -910,6 +910,14 @@ REBAR_GetUnicodeFormat (HWND hwnd)
 }
 
 
+inline static LRESULT
+REBAR_GetVersion (HWND hwnd)
+{
+    REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
+    return infoPtr->iVersion;
+}
+
+
 static LRESULT
 REBAR_HitTest (HWND hwnd, WPARAM wParam, LPARAM lParam)
 {
@@ -1522,6 +1530,21 @@ REBAR_SetUnicodeFormat (HWND hwnd, WPARAM wParam)
 }
 
 
+static LRESULT
+REBAR_SetVersion (HWND hwnd, INT iVersion)
+{
+    REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
+    INT iOldVersion = infoPtr->iVersion;
+
+    if (iVersion > COMCTL32_VERSION)
+	return -1;
+
+    infoPtr->iVersion = iVersion;
+
+    return iOldVersion;
+}
+
+
 static LRESULT
 REBAR_ShowBand (HWND hwnd, WPARAM wParam, LPARAM lParam)
 {
@@ -1592,6 +1615,7 @@ REBAR_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
     SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
 
     /* initialize info structure */
+    infoPtr->iVersion = 0;
     infoPtr->clrBk = CLR_NONE;
     infoPtr->clrText = RGB(0, 0, 0);
 
@@ -1919,6 +1943,9 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 	case RB_GETUNICODEFORMAT:
 	    return REBAR_GetUnicodeFormat (hwnd);
 
+	case CCM_GETVERSION:
+	    return REBAR_GetVersion (hwnd);
+
 	case RB_HITTEST:
 	    return REBAR_HitTest (hwnd, wParam, lParam);
 
@@ -1967,6 +1994,9 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 	case RB_SETUNICODEFORMAT:
 	    return REBAR_SetUnicodeFormat (hwnd, wParam);
 
+	case CCM_SETVERSION:
+	    return REBAR_SetVersion (hwnd, (INT)wParam);
+
 	case RB_SHOWBAND:
 	    return REBAR_ShowBand (hwnd, wParam, lParam);
 
diff --git a/include/rebar.h b/include/rebar.h
index c060141f23b..accf8ddf099 100644
--- a/include/rebar.h
+++ b/include/rebar.h
@@ -60,6 +60,7 @@ typedef struct tagREBAR_INFO
     HCURSOR  hcurHorz;    /* handle to the EW cursor */
     HCURSOR  hcurVert;    /* handle to the NS cursor */
     HCURSOR  hcurDrag;    /* handle to the drag cursor */
+    INT      iVersion;    /* version number */
 
     REBAR_BAND *bands;      /* pointer to the array of rebar bands */
 
-- 
GitLab