From 19c6edd497480feb99080ec1c8703ba875af0a6d Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Fri, 14 Aug 2009 22:23:21 -0400 Subject: [PATCH] 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 a62f955ff6..0a1343fbe0 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 80a6a070d3..e4e9ae03ad 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; -- 2.32.0.93.g670b81a890