Dylan Smith : wordpad: Use smaller cbSize for REBARBANDINFOW for compatibility.

Alexandre Julliard julliard at winehq.org
Mon Aug 17 11:23:55 CDT 2009


Module: wine
Branch: master
Commit: 19c6edd497480feb99080ec1c8703ba875af0a6d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=19c6edd497480feb99080ec1c8703ba875af0a6d

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Fri Aug 14 22:23:21 2009 -0400

wordpad: Use smaller cbSize for REBARBANDINFOW for compatibility.

The cbSize field for the REBARBANDINFOW structure was previously set to
the sizeof(REBARBANDINFOW), however, new fields were added to this
structure for newer version of windows.  Testing in Windows XP (or with
comctl32.dll from Windows XP) I found this larger size was rejected
causing the rebar to not be displayed in wordpad.

---

 programs/wordpad/print.c   |    4 ++--
 programs/wordpad/wordpad.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/programs/wordpad/print.c b/programs/wordpad/print.c
index a62f955..0a1343f 100644
--- a/programs/wordpad/print.c
+++ b/programs/wordpad/print.c
@@ -97,7 +97,7 @@ static void AddTextButton(HWND hRebarWnd, UINT string, UINT command, UINT id)
                             WS_VISIBLE | WS_CHILD, 5, 5, 100, 15,
                             hRebarWnd, ULongToHandle(command), hInstance, NULL);
 
-    rb.cbSize = sizeof(rb);
+    rb.cbSize = REBARBANDINFOW_V6_SIZE;
     rb.fMask = RBBIM_SIZE | RBBIM_CHILDSIZE | RBBIM_STYLE | RBBIM_CHILD | RBBIM_IDEALSIZE | RBBIM_ID;
     rb.fStyle = RBBS_NOGRIPPER | RBBS_VARIABLEHEIGHT;
     rb.hwndChild = hButton;
@@ -448,7 +448,7 @@ static void preview_bar_show(HWND hMainWnd, BOOL show)
                                 WS_VISIBLE | WS_CHILD, 0, 0, 0, 0,
                                 hReBar, NULL, NULL, NULL);
 
-        rb.cbSize = sizeof(rb);
+        rb.cbSize = REBARBANDINFOW_V6_SIZE;
         rb.fMask = RBBIM_SIZE | RBBIM_CHILDSIZE | RBBIM_STYLE | RBBIM_CHILD | RBBIM_IDEALSIZE | RBBIM_ID;
         rb.fStyle = RBBS_NOGRIPPER | RBBS_VARIABLEHEIGHT;
         rb.hwndChild = hStatic;
diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c
index 80a6a07..e4e9ae0 100644
--- a/programs/wordpad/wordpad.c
+++ b/programs/wordpad/wordpad.c
@@ -644,7 +644,7 @@ static void set_toolbar_state(int bandId, BOOL show)
         REBARBANDINFOW rbbinfo;
         int index = SendMessageW(hwndReBar, RB_IDTOINDEX, BANDID_FONTLIST, 0);
 
-        rbbinfo.cbSize = sizeof(rbbinfo);
+        rbbinfo.cbSize = REBARBANDINFOW_V6_SIZE;
         rbbinfo.fMask = RBBIM_STYLE;
 
         SendMessageW(hwndReBar, RB_GETBANDINFO, index, (LPARAM)&rbbinfo);
@@ -1795,7 +1795,7 @@ static LRESULT OnCreate( HWND hWnd )
 
     SendMessageW(hToolBarWnd, TB_AUTOSIZE, 0, 0);
 
-    rbb.cbSize = sizeof(rbb);
+    rbb.cbSize = REBARBANDINFOW_V6_SIZE;
     rbb.fMask = RBBIM_SIZE | RBBIM_CHILDSIZE | RBBIM_CHILD | RBBIM_STYLE | RBBIM_ID;
     rbb.fStyle = RBBS_CHILDEDGE | RBBS_BREAK | RBBS_NOGRIPPER;
     rbb.cx = 0;




More information about the wine-cvs mailing list