Commit 50c7fd4e authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

- Set hbrBackground class property to same value as native.

- Use Unicode window functions instead of ANSI.
parent 62d60b9b
...@@ -335,7 +335,7 @@ PAGER_CalcSize (HWND hwnd, INT* size, BOOL getWidth) ...@@ -335,7 +335,7 @@ PAGER_CalcSize (HWND hwnd, INT* size, BOOL getWidth)
nmpgcs.dwFlag = getWidth ? PGF_CALCWIDTH : PGF_CALCHEIGHT; nmpgcs.dwFlag = getWidth ? PGF_CALCWIDTH : PGF_CALCHEIGHT;
nmpgcs.iWidth = getWidth ? *size : 0; nmpgcs.iWidth = getWidth ? *size : 0;
nmpgcs.iHeight = getWidth ? 0 : *size; nmpgcs.iHeight = getWidth ? 0 : *size;
SendMessageA (infoPtr->hwndNotify, WM_NOTIFY, SendMessageW (infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)nmpgcs.hdr.idFrom, (LPARAM)&nmpgcs); (WPARAM)nmpgcs.hdr.idFrom, (LPARAM)&nmpgcs);
*size = getWidth ? nmpgcs.iWidth : nmpgcs.iHeight; *size = getWidth ? nmpgcs.iWidth : nmpgcs.iHeight;
...@@ -515,7 +515,7 @@ PAGER_UpdateBtns(HWND hwnd, PAGER_INFO *infoPtr, ...@@ -515,7 +515,7 @@ PAGER_UpdateBtns(HWND hwnd, PAGER_INFO *infoPtr,
} }
if (repaintBtns) if (repaintBtns)
SendMessageA(hwnd, WM_NCPAINT, 0, 0); SendMessageW(hwnd, WM_NCPAINT, 0, 0);
} }
static LRESULT static LRESULT
...@@ -571,7 +571,7 @@ PAGER_HandleWindowPosChanging(HWND hwnd, WPARAM wParam, WINDOWPOS *winpos) ...@@ -571,7 +571,7 @@ PAGER_HandleWindowPosChanging(HWND hwnd, WPARAM wParam, WINDOWPOS *winpos)
return 0; return 0;
} }
DefWindowProcA (hwnd, WM_WINDOWPOSCHANGING, wParam, (LPARAM)winpos); DefWindowProcW (hwnd, WM_WINDOWPOSCHANGING, wParam, (LPARAM)winpos);
return 1; return 1;
} }
...@@ -643,8 +643,8 @@ PAGER_SetFixedHeight(HWND hwnd, PAGER_INFO* infoPtr) ...@@ -643,8 +643,8 @@ PAGER_SetFixedHeight(HWND hwnd, PAGER_INFO* infoPtr)
* this module), the native control does only the following: * * this module), the native control does only the following: *
* * * *
* if (some condition) * * if (some condition) *
* PostMessageA(hwnd, EM_FMTLINES, 0, 0); * * PostMessageW(hwnd, EM_FMTLINES, 0, 0); *
* return DefWindowProcA(hwnd, PGM_RECALCSIZE, 0, 0); * * return DefWindowProcW(hwnd, PGM_RECALCSIZE, 0, 0); *
* * * *
* When we figure out what the "some condition" is we will * * When we figure out what the "some condition" is we will *
* implement that for the message processing. * * implement that for the message processing. *
...@@ -797,7 +797,7 @@ PAGER_Scroll(HWND hwnd, INT dir) ...@@ -797,7 +797,7 @@ PAGER_Scroll(HWND hwnd, INT dir)
} }
nmpgScroll.iScroll -= 2*infoPtr->nButtonSize; nmpgScroll.iScroll -= 2*infoPtr->nButtonSize;
SendMessageA (infoPtr->hwndNotify, WM_NOTIFY, SendMessageW (infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)nmpgScroll.hdr.idFrom, (LPARAM)&nmpgScroll); (WPARAM)nmpgScroll.hdr.idFrom, (LPARAM)&nmpgScroll);
TRACE("[%p] PGN_SCROLL returns iScroll=%d\n", hwnd, nmpgScroll.iScroll); TRACE("[%p] PGN_SCROLL returns iScroll=%d\n", hwnd, nmpgScroll.iScroll);
...@@ -830,7 +830,7 @@ PAGER_FmtLines(HWND hwnd) ...@@ -830,7 +830,7 @@ PAGER_FmtLines(HWND hwnd)
0,0,infoPtr->nWidth,infoPtr->nHeight, 0,0,infoPtr->nWidth,infoPtr->nHeight,
0); 0);
return DefWindowProcA (hwnd, EM_FMTLINES, 0, 0); return DefWindowProcW (hwnd, EM_FMTLINES, 0, 0);
} }
static LRESULT static LRESULT
...@@ -904,7 +904,7 @@ PAGER_NCCalcSize(HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -904,7 +904,7 @@ PAGER_NCCalcSize(HWND hwnd, WPARAM wParam, LPARAM lParam)
* coordinates of the corresponding window's client area. * coordinates of the corresponding window's client area.
*/ */
DefWindowProcA (hwnd, WM_NCCALCSIZE, wParam, lParam); DefWindowProcW (hwnd, WM_NCCALCSIZE, wParam, lParam);
TRACE("orig rect=(%ld,%ld)-(%ld,%ld)\n", TRACE("orig rect=(%ld,%ld)-(%ld,%ld)\n",
lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
...@@ -1029,7 +1029,7 @@ PAGER_NCPaint (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -1029,7 +1029,7 @@ PAGER_NCPaint (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (dwStyle & WS_MINIMIZE) if (dwStyle & WS_MINIMIZE)
return 0; return 0;
DefWindowProcA (hwnd, WM_NCPAINT, wParam, lParam); DefWindowProcW (hwnd, WM_NCPAINT, wParam, lParam);
if (!(hdc = GetDCEx (hwnd, 0, DCX_USESTYLE | DCX_WINDOW))) if (!(hdc = GetDCEx (hwnd, 0, DCX_USESTYLE | DCX_WINDOW)))
return 0; return 0;
...@@ -1155,7 +1155,7 @@ PAGER_SetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam ) ...@@ -1155,7 +1155,7 @@ PAGER_SetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam )
{ {
PAGER_CaptureandTrack(infoPtr, hwnd); PAGER_CaptureandTrack(infoPtr, hwnd);
SendMessageA(hwnd, WM_NCPAINT, 0, 0); SendMessageW(hwnd, WM_NCPAINT, 0, 0);
} }
return TRUE; return TRUE;
...@@ -1180,7 +1180,7 @@ PAGER_MouseLeave (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -1180,7 +1180,7 @@ PAGER_MouseLeave (HWND hwnd, WPARAM wParam, LPARAM lParam)
nmhdr.hwndFrom = hwnd; nmhdr.hwndFrom = hwnd;
nmhdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID); nmhdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID);
nmhdr.code = NM_RELEASEDCAPTURE; nmhdr.code = NM_RELEASEDCAPTURE;
SendMessageA (infoPtr->hwndNotify, WM_NOTIFY, SendMessageW (infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr); (WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr);
} }
...@@ -1253,7 +1253,7 @@ PAGER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -1253,7 +1253,7 @@ PAGER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
PAGER_DrawButton(hdc, infoPtr->clrBk, *btnrect, PAGER_DrawButton(hdc, infoPtr->clrBk, *btnrect,
PAGER_IsHorizontal(hwnd), topLeft, btnstate); PAGER_IsHorizontal(hwnd), topLeft, btnstate);
ReleaseDC(hwnd, hdc); ReleaseDC(hwnd, hdc);
return DefWindowProcA (hwnd, WM_MOUSEMOVE, wParam, lParam); return DefWindowProcW (hwnd, WM_MOUSEMOVE, wParam, lParam);
} }
} }
...@@ -1270,14 +1270,14 @@ PAGER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -1270,14 +1270,14 @@ PAGER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
nmhdr.hwndFrom = hwnd; nmhdr.hwndFrom = hwnd;
nmhdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID); nmhdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID);
nmhdr.code = NM_RELEASEDCAPTURE; nmhdr.code = NM_RELEASEDCAPTURE;
SendMessageA (infoPtr->hwndNotify, WM_NOTIFY, SendMessageW (infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr); (WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr);
} }
} }
if (IsWindow(hwnd)) if (IsWindow(hwnd))
KillTimer(hwnd, TIMERID1); KillTimer(hwnd, TIMERID1);
} }
return DefWindowProcA (hwnd, WM_MOUSEMOVE, wParam, lParam); return DefWindowProcW (hwnd, WM_MOUSEMOVE, wParam, lParam);
} }
static LRESULT static LRESULT
...@@ -1310,7 +1310,7 @@ PAGER_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -1310,7 +1310,7 @@ PAGER_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
} }
if (repaintBtns) if (repaintBtns)
SendMessageA(hwnd, WM_NCPAINT, 0, 0); SendMessageW(hwnd, WM_NCPAINT, 0, 0);
switch(hit) switch(hit)
{ {
...@@ -1417,7 +1417,7 @@ PAGER_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -1417,7 +1417,7 @@ PAGER_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam)
* pt.x=0; pt.y=0; ????? * pt.x=0; pt.y=0; ?????
* MapWindowPoints(pager, parent, &pt, 1) * MapWindowPoints(pager, parent, &pt, 1)
* OffsetWindowOrgEx(hdc, pt.x, pt.y, &ptorg) * OffsetWindowOrgEx(hdc, pt.x, pt.y, &ptorg)
* SendMessageA(parent, WM_ERASEBKGND, hdc, 0) * SendMessageW(parent, WM_ERASEBKGND, hdc, 0)
* SetWindowOrgEx(hdc, 0, 0, 0) * SetWindowOrgEx(hdc, 0, 0, 0)
*/ */
...@@ -1426,7 +1426,7 @@ PAGER_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -1426,7 +1426,7 @@ PAGER_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam)
parent = GetParent(hwnd); parent = GetParent(hwnd);
MapWindowPoints(hwnd, parent, &pt, 1); MapWindowPoints(hwnd, parent, &pt, 1);
OffsetWindowOrgEx (hdc, pt.x, pt.y, &ptorig); OffsetWindowOrgEx (hdc, pt.x, pt.y, &ptorig);
SendMessageA (parent, WM_ERASEBKGND, wParam, lParam); SendMessageW (parent, WM_ERASEBKGND, wParam, lParam);
SetWindowOrgEx (hdc, ptorig.x, ptorig.y, 0); SetWindowOrgEx (hdc, ptorig.x, ptorig.y, 0);
...@@ -1475,7 +1475,7 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -1475,7 +1475,7 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
if (!infoPtr && (uMsg != WM_CREATE)) if (!infoPtr && (uMsg != WM_CREATE))
return DefWindowProcA (hwnd, uMsg, wParam, lParam); return DefWindowProcW (hwnd, uMsg, wParam, lParam);
switch (uMsg) switch (uMsg)
{ {
...@@ -1551,7 +1551,7 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -1551,7 +1551,7 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
if (infoPtr->bForward && infoPtr->hwndChild) if (infoPtr->bForward && infoPtr->hwndChild)
PostMessageA(infoPtr->hwndChild, WM_MOUSEMOVE, wParam, lParam); PostMessageW(infoPtr->hwndChild, WM_MOUSEMOVE, wParam, lParam);
return PAGER_MouseMove (hwnd, wParam, lParam); return PAGER_MouseMove (hwnd, wParam, lParam);
case WM_MOUSELEAVE: case WM_MOUSELEAVE:
...@@ -1578,10 +1578,10 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -1578,10 +1578,10 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NOTIFY: case WM_NOTIFY:
case WM_COMMAND: case WM_COMMAND:
return SendMessageA (infoPtr->hwndNotify, uMsg, wParam, lParam); return SendMessageW (infoPtr->hwndNotify, uMsg, wParam, lParam);
default: default:
return DefWindowProcA (hwnd, uMsg, wParam, lParam); return DefWindowProcW (hwnd, uMsg, wParam, lParam);
} }
return 0; return 0;
...@@ -1591,23 +1591,23 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -1591,23 +1591,23 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
VOID VOID
PAGER_Register (void) PAGER_Register (void)
{ {
WNDCLASSA wndClass; WNDCLASSW wndClass;
ZeroMemory (&wndClass, sizeof(WNDCLASSA)); ZeroMemory (&wndClass, sizeof(WNDCLASSW));
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS; wndClass.style = CS_GLOBALCLASS;
wndClass.lpfnWndProc = (WNDPROC)PAGER_WindowProc; wndClass.lpfnWndProc = PAGER_WindowProc;
wndClass.cbClsExtra = 0; wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = sizeof(PAGER_INFO *); wndClass.cbWndExtra = sizeof(PAGER_INFO *);
wndClass.hCursor = LoadCursorA (0, (LPSTR)IDC_ARROW); wndClass.hCursor = LoadCursorW (0, (LPWSTR)IDC_ARROW);
wndClass.hbrBackground = 0; wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
wndClass.lpszClassName = WC_PAGESCROLLERA; wndClass.lpszClassName = WC_PAGESCROLLERW;
RegisterClassA (&wndClass); RegisterClassW (&wndClass);
} }
VOID VOID
PAGER_Unregister (void) PAGER_Unregister (void)
{ {
UnregisterClassA (WC_PAGESCROLLERA, NULL); UnregisterClassW (WC_PAGESCROLLERW, NULL);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment