From f436ded65973e1fe4a14c953a34f28fce671b482 Mon Sep 17 00:00:00 2001 From: vincents Date: Sun, 8 Apr 2007 12:12:28 +0000 Subject: [PATCH] win32 interface: fixed range errors git-svn-id: trunk@10919 - --- lcl/interfaces/win32/win32callback.inc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lcl/interfaces/win32/win32callback.inc b/lcl/interfaces/win32/win32callback.inc index a95a729b0a..d321d37f2a 100644 --- a/lcl/interfaces/win32/win32callback.inc +++ b/lcl/interfaces/win32/win32callback.inc @@ -220,6 +220,7 @@ Var winClassName: array[0..19] of char; WindowInfo: PWindowInfo; Flags: dword; + WindowDC: HDC; LMInsertText: TLMInsertText; // used by CB_INSERTSTRING, LB_INSERTSTRING LMScroll: TLMScroll; // used by WM_HSCROLL @@ -1183,6 +1184,7 @@ begin // only static and button controls have transparent parts // others need to erased with their window color // scrollbar also has buttons + WindowDC := HDC(WParam); ChildWindowInfo := GetWindowInfo(HWND(LParam)); ChildWinControl := ChildWindowInfo^.WinControl; if ChildWinControl = nil then @@ -1194,9 +1196,9 @@ begin and not ChildWindowInfo^.ThemedCustomDraw then begin // need to draw transparently, draw background - SendParentPaintMessage(LParam, Window, WParam); + SendParentPaintMessage(HWND(LParam), Window, WindowDC); LMessage.Result := GetStockObject(HOLLOW_BRUSH); - SetBkMode(WParam, TRANSPARENT); + SetBkMode(WindowDC, TRANSPARENT); WinProcess := false; end; end; @@ -1209,8 +1211,8 @@ begin begin if ChildWinControl <> nil then begin - Windows.SetTextColor(HDC(WParam), Windows.COLORREF(ColorToRGB(ChildWinControl.Font.Color))); - Windows.SetBkColor(HDC(WParam), Windows.COLORREF(ColorToRGB(ChildWinControl.Brush.Color))); + Windows.SetTextColor(WindowDC, Windows.COLORREF(ColorToRGB(ChildWinControl.Font.Color))); + Windows.SetBkColor(WindowDC, Windows.COLORREF(ColorToRGB(ChildWinControl.Brush.Color))); LMessage.Result := LResult(ChildWinControl.Brush.Handle); //DebugLn(['WindowProc ', ChildWinControl.Name, ' Brush: ', LMessage.Result]); // Override default handling