From b1d38fff4ac5a68920c1f3ac4f14b25a94ddcd48 Mon Sep 17 00:00:00 2001 From: Niels Date: Sat, 24 Apr 2010 21:04:39 +0200 Subject: [PATCH] Narrowed down the black-screen-colourpicker problem to the bitblt in ReturnData (I think). Removed an unneeded unit from os_windows and didn't get the black screen anymore, so I'm committing anyway =D --- Units/MMLCore/os_windows.pas | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Units/MMLCore/os_windows.pas b/Units/MMLCore/os_windows.pas index 7bef3f5..fd03155 100644 --- a/Units/MMLCore/os_windows.pas +++ b/Units/MMLCore/os_windows.pas @@ -27,7 +27,7 @@ unit os_windows; interface uses - Classes, SysUtils, mufasatypes, windows, graphics, LCLType, bitmaps, LCLIntf, IOManager, WinKeyInput; + Classes, SysUtils, mufasatypes, windows, graphics, LCLType, bitmaps, IOManager, WinKeyInput; type @@ -88,6 +88,7 @@ interface constructor Create(DesktopHandle : HWND); function WindowRect(out Rect : TRect) : Boolean;override; end; + TIOManager = class(TIOManager_Abstract) public constructor Create; @@ -250,7 +251,7 @@ implementation function TWindow.WindowRect(out Rect : TRect) : boolean; begin - result := GetWindowRect(self.handle,rect) <> 0; + result := Windows.GetWindowRect(self.handle,rect); end; function TWindow.ReturnData(xs, ys, width, height: Integer): TRetData; @@ -262,8 +263,9 @@ implementation ValidateBuffer(w,h); if (xs < 0) or (xs + width > w) or (ys < 0) or (ys + height > h) then raise Exception.CreateFMT('TMWindow.ReturnData: The parameters passed are wrong; xs,ys %d,%d width,height %d,%d',[xs,ys,width,height]); - BitBlt(self.buffer.Canvas.Handle,0,0, width, height, self.dc, xs,ys, SRCCOPY); + Windows.BitBlt(self.buffer.Canvas.Handle,0,0, width, height, self.dc, xs,ys, SRCCOPY); Result.Ptr:= self.buffer_raw; + Result.IncPtrWith:= w - width; Result.RowLen:= w; end; @@ -420,6 +422,8 @@ begin end; + + function TDesktopWindow.WindowRect(out Rect : TRect) : Boolean; begin Rect.Left:= GetSystemMetrics(SM_XVIRTUALSCREEN);