Sync with trunk r63174.
[reactos.git] / dll / win32 / comctl32 / comctl32_ros.diff
1 diff -prudN e:\Wine\dlls\comctl32/comctl32.spec e:\reactos\dll\win32\comctl32/comctl32.spec
2 --- e:\Wine\dlls\comctl32/comctl32.spec 2014-04-04 14:12:39.665980800 +0100
3 +++ e:\reactos\dll\win32\comctl32/comctl32.spec 2014-03-27 14:27:25.808903400 +0100
4 @@ -15,7 +15,7 @@
5 11 stdcall -noname DPA_Merge(ptr ptr long ptr ptr long)
6 #12 stub Cctl1632_ThunkData32
7 13 stdcall MakeDragList(long)
8 - 14 stdcall LBItemFromPt(long int64 long)
9 + 14 stdcall LBItemFromPt(long double long) #(long int64 long)
10 15 stdcall DrawInsert(long long long)
11 16 stdcall CreateUpDownControl(long long long long long long long long long long long long)
12 17 stdcall InitCommonControls()
13 @@ -30,8 +30,8 @@
14 155 stdcall -noname FindMRUStringA(long str ptr)
15 156 stdcall -noname DelMRUString(long long)
16 157 stdcall -noname CreateMRUListLazyA(ptr long long long)
17 -163 stub -noname CreatePage
18 -164 stub -noname CreateProxyPage
19 +163 stdcall -noname CreatePage(long ptr)
20 +164 stdcall -noname CreateProxyPage(long long)
21 167 stdcall -noname AddMRUData(long ptr long)
22 169 stdcall -noname FindMRUData(long ptr long ptr)
23 233 stdcall -noname Str_GetPtrA(str str long)
24 @@ -89,13 +89,13 @@
25 376 stdcall -noname -private IntlStrEqWorkerA(long str str long)
26 377 stdcall -noname -private IntlStrEqWorkerW(long wstr wstr long)
27 382 stdcall -noname SmoothScrollWindow(ptr)
28 -383 stub -noname DoReaderMode
29 +383 stdcall -noname DoReaderMode(ptr)
30 384 stdcall -noname SetPathWordBreakProc(ptr long)
31 385 stdcall -ordinal DPA_EnumCallback(long long long)
32 386 stdcall -ordinal DPA_DestroyCallback(ptr ptr long)
33 387 stdcall -ordinal DSA_EnumCallback(ptr ptr long)
34 388 stdcall -ordinal DSA_DestroyCallback(ptr ptr long)
35 -389 stub -noname SHGetProcessDword
36 +389 stdcall -noname SHGetProcessDword(long long)
37 390 stdcall -noname ImageList_SetColorTable(ptr long long ptr)
38 400 stdcall -ordinal CreateMRUListW(ptr)
39 401 stdcall -ordinal AddMRUStringW(long wstr)
40 @@ -189,5 +189,6 @@
41 @ stdcall PropertySheet(ptr) PropertySheetA
42 @ stdcall PropertySheetA(ptr)
43 @ stdcall PropertySheetW(ptr)
44 +@ stdcall RegisterClassNameW(wstr)
45 @ stdcall UninitializeFlatSB(long)
46 @ stdcall _TrackMouseEvent(ptr)
47
48 diff -prudN e:\Wine\dlls\comctl32/commctrl.c e:\reactos\dll\win32\comctl32/commctrl.c
49 --- e:\Wine\dlls\comctl32/commctrl.c 2014-04-04 14:12:39.666981500 +0100
50 +++ e:\reactos\dll\win32\comctl32/commctrl.c 2014-04-06 12:07:15.451048000 +0100
51 @@ -52,25 +52,26 @@
52 * -- ICC_WIN95_CLASSES
53 */
54
55 -#include <stdarg.h>
56 -#include <string.h>
57 -#include <stdlib.h>
58 +#include "comctl32.h"
59
60 -#include "windef.h"
61 -#include "winbase.h"
62 -#include "wingdi.h"
63 -#include "winuser.h"
64 -#include "winnls.h"
65 -#include "commctrl.h"
66 -#include "winerror.h"
67 -#include "winreg.h"
68 #define NO_SHLWAPI_STREAM
69 -#include "shlwapi.h"
70 -#include "comctl32.h"
71 -#include "wine/debug.h"
72 +#include <shlwapi.h>
73
74 WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
75
76 +#define NAME L"microsoft.windows.common-controls"
77 +#define VERSION L"6.0.2600.2982"
78 +#define PUBLIC_KEY L"6595b64144ccf1df"
79 +
80 +#ifdef __i386__
81 +#define ARCH L"x86"
82 +#elif defined __x86_64__
83 +#define ARCH L"amd64"
84 +#else
85 +#define ARCH L"none"
86 +#endif
87 +
88 +static const WCHAR manifest_filename[] = ARCH L"_" NAME L"_" PUBLIC_KEY L"_" VERSION L"_none_deadbeef.manifest";
89
90 static LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
91
92 @@ -92,6 +93,67 @@ static const WCHAR strCC32SubclassInfo[]
93 'C','C','3','2','S','u','b','c','l','a','s','s','I','n','f','o',0
94 };
95
96 +static BOOL create_manifest(BOOL install)
97 +{
98 + WCHAR *pwszBuf;
99 + HRSRC hResInfo;
100 + HGLOBAL hResData;
101 + PVOID pManifest;
102 + DWORD cchBuf, cbManifest, cbWritten;
103 + HANDLE hFile;
104 + BOOL bRet = FALSE;
105 +
106 + hResInfo = FindResourceW(COMCTL32_hModule, L"WINE_MANIFEST", (LPWSTR)RT_MANIFEST);
107 + if (!hResInfo)
108 + return FALSE;
109 +
110 + cbManifest = SizeofResource(COMCTL32_hModule, hResInfo);
111 + if (!cbManifest)
112 + return FALSE;
113 +
114 + hResData = LoadResource(COMCTL32_hModule, hResInfo);
115 + if (!hResData)
116 + return FALSE;
117 +
118 + pManifest = LockResource(hResData);
119 + if (!pManifest)
120 + return FALSE;
121 +
122 + cchBuf = GetWindowsDirectoryW(NULL, 0) * sizeof(WCHAR) + sizeof(L"\\winsxs\\manifests\\") + sizeof(manifest_filename);
123 + pwszBuf = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, cchBuf * sizeof(WCHAR));
124 + if (!pwszBuf)
125 + return FALSE;
126 +
127 + GetWindowsDirectoryW(pwszBuf, cchBuf);
128 + lstrcatW(pwszBuf, L"\\winsxs");
129 + CreateDirectoryW(pwszBuf, NULL);
130 + lstrcatW(pwszBuf, L"\\manifests\\");
131 + CreateDirectoryW(pwszBuf, NULL);
132 + lstrcatW(pwszBuf, manifest_filename);
133 + if (install)
134 + {
135 + hFile = CreateFileW(pwszBuf, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
136 + if (hFile != INVALID_HANDLE_VALUE)
137 + {
138 + if (WriteFile(hFile, pManifest, cbManifest, &cbWritten, NULL) && cbWritten == cbManifest)
139 + bRet = TRUE;
140 +
141 + CloseHandle(hFile);
142 +
143 + if (!bRet)
144 + DeleteFileW(pwszBuf);
145 + else
146 + TRACE("created %s\n", debugstr_w(pwszBuf));
147 + }
148 + }
149 + else
150 + bRet = DeleteFileW(pwszBuf);
151 +
152 + HeapFree(GetProcessHeap(), 0, pwszBuf);
153 +
154 + return bRet;
155 +}
156 +
157
158 /***********************************************************************
159 * DllMain [Internal]
160 @@ -928,6 +990,12 @@ HRESULT WINAPI DllGetVersion (DLLVERSION
161 HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
162 {
163 TRACE("(%u, %s): stub\n", bInstall, debugstr_w(cmdline));
164 + if (!create_manifest(bInstall))
165 + {
166 + ERR("create_manifest failed!\n");
167 + return HRESULT_FROM_WIN32(GetLastError());
168 + }
169 +
170 return S_OK;
171 }
172
173 @@ -1591,12 +1659,114 @@ LRESULT WINAPI SetPathWordBreakProc(HWND
174 *
175 * Draw text with shadow.
176 */
177 -int WINAPI DrawShadowText(HDC hdc, LPCWSTR pszText, UINT cch, RECT *rect, DWORD dwFlags,
178 +int WINAPI DrawShadowText(HDC hdc, LPCWSTR pszText, UINT cch, RECT *prc, DWORD dwFlags,
179 COLORREF crText, COLORREF crShadow, int ixOffset, int iyOffset)
180 {
181 - FIXME("(%p, %s, %d, %p, %d, 0x%08x, 0x%08x, %d, %d): stub\n", hdc, debugstr_w(pszText), cch, rect, dwFlags,
182 - crText, crShadow, ixOffset, iyOffset);
183 - return DrawTextW(hdc, pszText, cch, rect, DT_LEFT);
184 + COLORREF crOldText;
185 + RECT rcText;
186 + INT iRet, x, y, x2, y2;
187 + BYTE *pBits;
188 + HBITMAP hbm, hbmOld;
189 + BITMAPINFO bi;
190 + HDC hdcMem;
191 + HFONT hOldFont;
192 + BLENDFUNCTION bf;
193 +
194 + /* Create 32 bit DIB section for the shadow */
195 + ZeroMemory(&bi, sizeof(bi));
196 + bi.bmiHeader.biSize = sizeof(bi.bmiHeader);
197 + bi.bmiHeader.biWidth = prc->right - prc->left + 4;
198 + bi.bmiHeader.biHeight = prc->bottom - prc->top + 5; // bottom-up DIB
199 + bi.bmiHeader.biPlanes = 1;
200 + bi.bmiHeader.biBitCount = 32;
201 + bi.bmiHeader.biCompression = BI_RGB;
202 + hbm = CreateDIBSection(hdc, &bi, DIB_RGB_COLORS, (PVOID*)&pBits, NULL, 0);
203 + if(!hbm)
204 + {
205 + ERR("CreateDIBSection failed\n");
206 + return 0;
207 + }
208 +
209 + /* Create memory device context for new DIB section and select it */
210 + hdcMem = CreateCompatibleDC(hdc);
211 + if(!hdcMem)
212 + {
213 + ERR("CreateCompatibleDC failed\n");
214 + DeleteObject(hbm);
215 + return 0;
216 + }
217 +
218 + hbmOld = (HBITMAP)SelectObject(hdcMem, hbm);
219 +
220 + /* Draw text on our helper bitmap */
221 + hOldFont = (HFONT)SelectObject(hdcMem, GetCurrentObject(hdc, OBJ_FONT));
222 + SetTextColor(hdcMem, RGB(16, 16, 16));
223 + SetBkColor(hdcMem, RGB(0, 0, 0));
224 + SetBkMode(hdcMem, TRANSPARENT);
225 + SetRect(&rcText, 0, 0, prc->right - prc->left, prc->bottom - prc->top);
226 + DrawTextW(hdcMem, pszText, cch, &rcText, dwFlags);
227 + SelectObject(hdcMem, hOldFont);
228 +
229 + /* Flush GDI so data pointed by pBits is valid */
230 + GdiFlush();
231 +
232 + /* Set alpha of pixels (forget about colors for now. They will be changed in next loop).
233 + We copy text image 4*5 times and each time alpha is added */
234 + for (x = 0; x < bi.bmiHeader.biWidth; ++x)
235 + for (y = 0; y < bi.bmiHeader.biHeight; ++y)
236 + {
237 + BYTE *pDest = &pBits[(y * bi.bmiHeader.biWidth + x) * 4];
238 + UINT Alpha = 0;
239 +
240 + for (x2 = x - 4 + 1; x2 <= x; ++x2)
241 + for (y2 = y; y2 < y + 5; ++y2)
242 + {
243 + if (x2 >= 0 && x2 < bi.bmiHeader.biWidth && y2 >= 0 && y2 < bi.bmiHeader.biHeight)
244 + {
245 + BYTE *pSrc = &pBits[(y2 * bi.bmiHeader.biWidth + x2) * 4];
246 + Alpha += pSrc[0];
247 + }
248 + }
249 +
250 + if (Alpha > 255)
251 + Alpha = 255;
252 + pDest[3] = Alpha;
253 + }
254 +
255 + /* Now set the color of each pixel to shadow color * alpha (see GdiAlphaBlend) */
256 + for (x = 0; x < bi.bmiHeader.biWidth; ++x)
257 + for (y = 0; y < bi.bmiHeader.biHeight; ++y)
258 + {
259 + BYTE *pDest = &pBits[(y * bi.bmiHeader.biWidth + x) * 4];
260 + pDest[0] = GetBValue(crShadow) * pDest[3] / 255;
261 + pDest[1] = GetGValue(crShadow) * pDest[3] / 255;
262 + pDest[2] = GetRValue(crShadow) * pDest[3] / 255;
263 + }
264 +
265 + /* Fix ixOffset of the shadow (tested on Win) */
266 + ixOffset -= 3;
267 + iyOffset -= 3;
268 +
269 + /* Alpha blend helper image to destination DC */
270 + bf.BlendOp = AC_SRC_OVER;
271 + bf.BlendFlags = 0;
272 + bf.SourceConstantAlpha = 255;
273 + bf.AlphaFormat = AC_SRC_ALPHA;
274 + if (!GdiAlphaBlend(hdc, prc->left + ixOffset, prc->top + iyOffset, bi.bmiHeader.biWidth, bi.bmiHeader.biHeight, hdcMem, 0, 0, bi.bmiHeader.biWidth, bi.bmiHeader.biHeight, bf))
275 + ERR("GdiAlphaBlend failed: %lu\n", GetLastError());
276 +
277 + /* Delete the helper bitmap */
278 + SelectObject(hdcMem, hbmOld);
279 + DeleteObject(hbm);
280 + DeleteDC(hdcMem);
281 +
282 + /* Finally draw the text over shadow */
283 + crOldText = SetTextColor(hdc, crText);
284 + SetBkMode(hdc, TRANSPARENT);
285 + iRet = DrawTextW(hdc, pszText, cch, prc, dwFlags);
286 + SetTextColor(hdc, crOldText);
287 +
288 + return iRet;
289 }
290
291 /***********************************************************************
292 @@ -1637,3 +1807,15 @@ HRESULT WINAPI TaskDialogIndirect(const
293 if (pfVerificationFlagChecked) *pfVerificationFlagChecked = TRUE;
294 return S_OK;
295 }
296 +
297 +/***********************************************************************
298 + * RegisterClassNameW [COMCTL32.@]
299 + *
300 + * Register window class again while using as SxS module.
301 + */
302 +BOOLEAN WINAPI RegisterClassNameW(LPCWSTR className)
303 +{
304 + /* FIXME: actually register redirected user32 class,
305 + comctl32 classes are registered by this module anyway */
306 + return TRUE;
307 +}
308
309 diff -prudN e:\Wine\dlls\comctl32/listview.c e:\reactos\dll\win32\comctl32/listview.c
310 --- e:\Wine\dlls\comctl32/listview.c 2014-04-18 20:39:25.506861000 +0100
311 +++ e:\reactos\dll\win32\comctl32/listview.c 2014-04-22 13:09:20.504496900 +0100
312 @@ -307,6 +288,7 @@ typedef struct tagLISTVIEW_INFO
313 COLORREF clrBk;
314 COLORREF clrText;
315 COLORREF clrTextBk;
316 + BOOL bDefaultBkColor;
317
318 /* font */
319 HFONT hDefaultFont;
320 @@ -1693,8 +1675,19 @@ static inline BOOL LISTVIEW_GetItemW(con
321 /* used to handle collapse main item column case */
322 static inline BOOL LISTVIEW_DrawFocusRect(const LISTVIEW_INFO *infoPtr, HDC hdc)
323 {
324 - return (infoPtr->rcFocus.left < infoPtr->rcFocus.right) ?
325 - DrawFocusRect(hdc, &infoPtr->rcFocus) : FALSE;
326 + BOOL Ret = FALSE;
327 +
328 + if (infoPtr->rcFocus.left < infoPtr->rcFocus.right)
329 + {
330 + DWORD dwOldBkColor, dwOldTextColor;
331 +
332 + dwOldBkColor = SetBkColor(hdc, RGB(255, 255, 255));
333 + dwOldTextColor = SetBkColor(hdc, RGB(0, 0, 0));
334 + Ret = DrawFocusRect(hdc, &infoPtr->rcFocus);
335 + SetBkColor(hdc, dwOldBkColor);
336 + SetBkColor(hdc, dwOldTextColor);
337 + }
338 + return Ret;
339 }
340
341 /* Listview invalidation functions: use _only_ these functions to invalidate */
342 @@ -4727,7 +4720,12 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_I
343 if (infoPtr->uView == LV_VIEW_DETAILS && infoPtr->dwLvExStyle & LVS_EX_GRIDLINES)
344 rcLabel.bottom--;
345
346 - DrawTextW(hdc, lvItem.pszText, -1, &rcLabel, uFormat);
347 +#ifdef __REACTOS__
348 + if ((!(lvItem.state & LVIS_SELECTED) || !infoPtr->bFocus) && (infoPtr->dwLvExStyle & LVS_EX_TRANSPARENTSHADOWTEXT))
349 + DrawShadowText(hdc, lvItem.pszText, -1, &rcLabel, uFormat, RGB(255, 255, 255), RGB(0, 0, 0), 2, 2);
350 + else
351 +#endif
352 + DrawTextW(hdc, lvItem.pszText, -1, &rcLabel, uFormat);
353
354 postpaint:
355 if (cdsubitemmode & CDRF_NOTIFYPOSTPAINT)
356 @@ -5136,7 +5134,11 @@ enddraw:
357
358 /* Draw marquee rectangle if appropriate */
359 if (infoPtr->bMarqueeSelect)
360 + {
361 + SetBkColor(hdc, RGB(255, 255, 255));
362 + SetTextColor(hdc, RGB(0, 0, 0));
363 DrawFocusRect(hdc, &infoPtr->marqueeDrawRect);
364 + }
365
366 if (cdmode & CDRF_NOTIFYPOSTPAINT)
367 notify_postpaint(infoPtr, &nmlvcd);
368 @@ -7939,6 +7941,7 @@ static BOOL LISTVIEW_SetBkColor(LISTVIEW
369 {
370 TRACE("(color=%x)\n", color);
371
372 + infoPtr->bDefaultBkColor = FALSE;
373 if(infoPtr->clrBk != color) {
374 if (infoPtr->clrBk != CLR_NONE) DeleteObject(infoPtr->hBkBrush);
375 infoPtr->clrBk = color;
376 @@ -8600,7 +8603,7 @@ static DWORD LISTVIEW_SetIconSpacing(LIS
377 return oldspacing;
378 }
379
380 -static inline void set_icon_size(SIZE *size, HIMAGELIST himl, BOOL small)
381 +static inline void set_icon_size(SIZE *size, HIMAGELIST himl, BOOL is_small)
382 {
383 INT cx, cy;
384
385 @@ -8611,8 +8614,8 @@ static inline void set_icon_size(SIZE *s
386 }
387 else
388 {
389 - size->cx = GetSystemMetrics(small ? SM_CXSMICON : SM_CXICON);
390 - size->cy = GetSystemMetrics(small ? SM_CYSMICON : SM_CYICON);
391 + size->cx = GetSystemMetrics(is_small ? SM_CXSMICON : SM_CXICON);
392 + size->cy = GetSystemMetrics(is_small ? SM_CYSMICON : SM_CYICON);
393 }
394 }
395
396 @@ -9349,6 +9352,7 @@ static LRESULT LISTVIEW_NCCreate(HWND hw
397 infoPtr->clrText = CLR_DEFAULT;
398 infoPtr->clrTextBk = CLR_DEFAULT;
399 LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow);
400 + infoPtr->bDefaultBkColor = TRUE;
401
402 /* set default values */
403 infoPtr->nFocusedItem = -1;
404 @@ -11631,6 +11635,12 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg
405
406 case WM_SYSCOLORCHANGE:
407 COMCTL32_RefreshSysColors();
408 + if (infoPtr->bDefaultBkColor)
409 + {
410 + LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow);
411 + infoPtr->bDefaultBkColor = TRUE;
412 + LISTVIEW_InvalidateList(infoPtr);
413 + }
414 return 0;
415
416 /* case WM_TIMER: */
417
418 diff -prudN e:\Wine\dlls\comctl32/propsheet.c e:\reactos\dll\win32\comctl32/propsheet.c
419 --- e:\Wine\dlls\comctl32/propsheet.c 2014-04-04 14:12:39.676987100 +0100
420 +++ e:\reactos\dll\win32\comctl32/propsheet.c 2014-04-22 13:11:33.830045900 +0100
421 @@ -2430,6 +2414,11 @@ static void PROPSHEET_SetWizButtons(HWND
422 HWND hwndBack = GetDlgItem(hwndDlg, IDC_BACK_BUTTON);
423 HWND hwndNext = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON);
424 HWND hwndFinish = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON);
425 +#ifdef __REACTOS__
426 + HWND hwndCancel = GetDlgItem(hwndDlg, IDCANCEL);
427 + INT iDefItem = 0;
428 + HWND hwndFocus;
429 +#endif
430
431 TRACE("%d\n", dwFlags);
432
433 @@ -2437,6 +2426,7 @@ static void PROPSHEET_SetWizButtons(HWND
434 EnableWindow(hwndNext, FALSE);
435 EnableWindow(hwndFinish, FALSE);
436
437 +#ifndef __REACTOS__
438 /* set the default pushbutton to an enabled button */
439 if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH))
440 SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0);
441 @@ -2446,6 +2436,7 @@ static void PROPSHEET_SetWizButtons(HWND
442 SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0);
443 else
444 SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0);
445 +#endif
446
447
448 if (dwFlags & PSWIZB_BACK)
449 @@ -2477,6 +2468,25 @@ static void PROPSHEET_SetWizButtons(HWND
450 }
451 else if (!(dwFlags & PSWIZB_DISABLEDFINISH))
452 EnableWindow(hwndFinish, TRUE);
453 +
454 +#ifdef __REACTOS__
455 + /* set the default pushbutton to an enabled button */
456 + if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH))
457 + iDefItem = IDC_FINISH_BUTTON;
458 + else if (dwFlags & PSWIZB_NEXT)
459 + iDefItem = IDC_NEXT_BUTTON;
460 + else if (dwFlags & PSWIZB_BACK)
461 + iDefItem = IDC_BACK_BUTTON;
462 + else
463 + iDefItem = IDCANCEL;
464 + SendMessageW(hwndDlg, DM_SETDEFID, iDefItem, 0);
465 +
466 + /* Set focus if no control has it */
467 + hwndFocus = GetFocus();
468 + if (!hwndFocus || hwndFocus == hwndCancel)
469 + SetFocus(GetDlgItem(hwndDlg, iDefItem));
470 +#endif
471 +
472 }
473
474 /******************************************************************************
475 diff -prudN e:\Wine\dlls\comctl32/rebar.c e:\reactos\dll\win32\comctl32/rebar.c
476 --- e:\Wine\dlls\comctl32/rebar.c 2014-04-04 14:12:39.678989500 +0100
477 +++ e:\reactos\dll\win32\comctl32/rebar.c 2014-04-22 13:17:59.092589800 +0100
478 @@ -50,7 +50,6 @@
479 * - WM_QUERYNEWPALETTE
480 * - WM_RBUTTONDOWN
481 * - WM_RBUTTONUP
482 - * - WM_SYSCOLORCHANGE
483 * - WM_VKEYTOITEM
484 * - WM_WININICHANGE
485 * Notifications:
486 @@ -2912,12 +2896,22 @@ REBAR_ShowBand (REBAR_INFO *infoPtr, INT
487
488
489 static LRESULT
490 -REBAR_SizeToRect (REBAR_INFO *infoPtr, const RECT *lpRect)
491 +REBAR_SizeToRect (REBAR_INFO *infoPtr, WPARAM flags, RECT *lpRect)
492 {
493 if (!lpRect) return FALSE;
494
495 TRACE("[%s]\n", wine_dbgstr_rect(lpRect));
496 REBAR_SizeToHeight(infoPtr, get_rect_cy(infoPtr, lpRect));
497 +
498 +#ifdef __REACTOS__
499 + /* Note that this undocumented flag is available on comctl32 v6 or later */
500 + if ((flags & RBSTR_CHANGERECT) != 0)
501 + {
502 + RECT rcRebar;
503 + GetClientRect(infoPtr->hwndSelf, &rcRebar);
504 + lpRect->bottom = lpRect->top + (rcRebar.bottom - rcRebar.top);
505 + }
506 +#endif
507 return TRUE;
508 }
509
510 @@ -3675,7 +3669,7 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg,
511 return REBAR_ShowBand (infoPtr, wParam, lParam);
512
513 case RB_SIZETORECT:
514 - return REBAR_SizeToRect (infoPtr, (LPCRECT)lParam);
515 + return REBAR_SizeToRect (infoPtr, wParam, (LPRECT)lParam);
516
517
518 /* Messages passed to parent */
519 @@ -3758,6 +3752,11 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg,
520
521 case WM_SYSCOLORCHANGE:
522 COMCTL32_RefreshSysColors();
523 +#ifdef __REACTOS__
524 + /* r51522 - Properly support WM_SYSCOLORCHANGE */
525 + infoPtr->clrBtnText = comctl32_color.clrBtnText;
526 + infoPtr->clrBtnFace = comctl32_color.clrBtnFace;
527 +#endif
528 return 0;
529
530 /* case WM_VKEYTOITEM: supported according to ControlSpy */
531
532 diff -prudN e:\Wine\dlls\comctl32/tooltips.c e:\reactos\dll\win32\comctl32/tooltips.c
533 --- e:\Wine\dlls\comctl32/tooltips.c 2014-04-04 14:12:39.707008100 +0100
534 +++ e:\reactos\dll\win32\comctl32/tooltips.c 2014-04-06 12:20:33.342535700 +0100
535 @@ -2007,7 +1994,32 @@ TOOLTIPS_NCHitTest (const TOOLTIPS_INFO
536 static LRESULT
537 TOOLTIPS_NotifyFormat (TOOLTIPS_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
538 {
539 - FIXME ("hwnd=%p wParam=%lx lParam=%lx\n", infoPtr->hwndSelf, wParam, lParam);
540 + TTTOOL_INFO *toolPtr = infoPtr->tools;
541 + LRESULT nResult;
542 +
543 + TRACE("infoPtr=%p wParam=%lx lParam=%p\n", infoPtr, wParam, (PVOID)lParam);
544 +
545 + if (lParam == NF_QUERY) {
546 + if (toolPtr->bNotifyUnicode) {
547 + return NFR_UNICODE;
548 + } else {
549 + return NFR_ANSI;
550 + }
551 + }
552 + else if (lParam == NF_REQUERY) {
553 + nResult = SendMessageW (toolPtr->hwnd, WM_NOTIFYFORMAT,
554 + (WPARAM)infoPtr->hwndSelf, (LPARAM)NF_QUERY);
555 + if (nResult == NFR_ANSI) {
556 + toolPtr->bNotifyUnicode = FALSE;
557 + TRACE(" -- WM_NOTIFYFORMAT returns: NFR_ANSI\n");
558 + } else if (nResult == NFR_UNICODE) {
559 + toolPtr->bNotifyUnicode = TRUE;
560 + TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");
561 + } else {
562 + TRACE (" -- WM_NOTIFYFORMAT returns: error!\n");
563 + }
564 + return nResult;
565 + }
566
567 return 0;
568 }
569 diff -prudN e:\Wine\dlls\comctl32/treeview.c e:\reactos\dll\win32\comctl32/treeview.c
570 --- e:\Wine\dlls\comctl32/treeview.c 2014-04-04 14:12:39.709009500 +0100
571 +++ e:\reactos\dll\win32\comctl32/treeview.c 2014-04-06 12:22:08.977839700 +0100
572 @@ -2921,7 +2899,12 @@ TREEVIEW_Refresh(TREEVIEW_INFO *infoPtr,
573 }
574 }
575
576 - TREEVIEW_UpdateScrollBars(infoPtr);
577 + //
578 + // This is correct, but is causes and infinite loop of WM_PAINT messages, resulting
579 + // in continuous painting of the scroll bar in reactos. Comment out until the real
580 + // bug is found
581 + //
582 + //TREEVIEW_UpdateScrollBars(infoPtr);
583
584 if (infoPtr->cdmode & CDRF_NOTIFYPOSTPAINT)
585 infoPtr->cdmode =