1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-11 03:45:06 -05:00

Merge previous revision + added GetNativeWindow and GetImageTarget.

Also fixed OCRBench.

Also committing the .lpi's as svn sucks ass. :-) 
EXCEPT FOR THE SAMUFASAGUI .lpi AS IT HAS BEEN LOCKED, lmfao




git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@468 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Wizzup? 2010-01-25 21:21:18 +00:00
parent 8addf78a8a
commit b1d07ff6d4
6 changed files with 225 additions and 120 deletions

View File

@ -7,7 +7,7 @@
<TargetFileExt Value=""/>
<Icon Value="0"/>
<UseXPManifest Value="True"/>
<ActiveEditorIndexAtStart Value="7"/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
@ -31,12 +31,12 @@
<PackageName Value="LCL"/>
</Item1>
</RequiredPackages>
<Units Count="20">
<Units Count="23">
<Unit0>
<Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="project1"/>
<UsageCount Value="67"/>
<UsageCount Value="69"/>
</Unit0>
<Unit1>
<Filename Value="unit1.pas"/>
@ -44,10 +44,10 @@
<ComponentName Value="Form1"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="Unit1"/>
<CursorPos X="103" Y="81"/>
<TopLine Value="67"/>
<CursorPos X="30" Y="15"/>
<TopLine Value="1"/>
<EditorIndex Value="0"/>
<UsageCount Value="67"/>
<UsageCount Value="69"/>
<Loaded Value="True"/>
</Unit1>
<Unit2>
@ -73,10 +73,10 @@
<Unit4>
<Filename Value="../../Units/MMLCore/client.pas"/>
<UnitName Value="Client"/>
<CursorPos X="25" Y="50"/>
<TopLine Value="31"/>
<EditorIndex Value="4"/>
<UsageCount Value="34"/>
<CursorPos X="27" Y="48"/>
<TopLine Value="30"/>
<EditorIndex Value="7"/>
<UsageCount Value="35"/>
<Loaded Value="True"/>
</Unit4>
<Unit5>
@ -84,8 +84,8 @@
<UnitName Value="ocr"/>
<CursorPos X="73" Y="16"/>
<TopLine Value="1"/>
<EditorIndex Value="6"/>
<UsageCount Value="34"/>
<EditorIndex Value="9"/>
<UsageCount Value="35"/>
<Loaded Value="True"/>
</Unit5>
<Unit6>
@ -93,8 +93,8 @@
<UnitName Value="bitmaps"/>
<CursorPos X="18" Y="81"/>
<TopLine Value="47"/>
<EditorIndex Value="12"/>
<UsageCount Value="33"/>
<EditorIndex Value="14"/>
<UsageCount Value="34"/>
<Loaded Value="True"/>
</Unit6>
<Unit7>
@ -102,8 +102,8 @@
<UnitName Value="ocrutil"/>
<CursorPos X="39" Y="208"/>
<TopLine Value="1"/>
<EditorIndex Value="3"/>
<UsageCount Value="33"/>
<EditorIndex Value="6"/>
<UsageCount Value="34"/>
<Loaded Value="True"/>
</Unit7>
<Unit8>
@ -117,17 +117,15 @@
<UnitName Value="tpa"/>
<CursorPos X="5" Y="557"/>
<TopLine Value="535"/>
<EditorIndex Value="11"/>
<UsageCount Value="31"/>
<Loaded Value="True"/>
</Unit9>
<Unit10>
<Filename Value="../../Units/MMLCore/mufasatypesutil.pas"/>
<UnitName Value="mufasatypesutil"/>
<CursorPos X="25" Y="8"/>
<TopLine Value="1"/>
<EditorIndex Value="9"/>
<UsageCount Value="30"/>
<EditorIndex Value="12"/>
<UsageCount Value="31"/>
<Loaded Value="True"/>
</Unit10>
<Unit11>
@ -135,8 +133,8 @@
<UnitName Value="finder"/>
<CursorPos X="78" Y="455"/>
<TopLine Value="432"/>
<EditorIndex Value="5"/>
<UsageCount Value="27"/>
<EditorIndex Value="8"/>
<UsageCount Value="28"/>
<Loaded Value="True"/>
</Unit11>
<Unit12>
@ -156,24 +154,26 @@
<UnitName Value="files"/>
<CursorPos X="7" Y="103"/>
<TopLine Value="34"/>
<EditorIndex Value="8"/>
<UsageCount Value="24"/>
<EditorIndex Value="11"/>
<UsageCount Value="25"/>
<Loaded Value="True"/>
</Unit14>
<Unit15>
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<UnitName Value="colourpicker"/>
<CursorPos X="20" Y="56"/>
<TopLine Value="37"/>
<UsageCount Value="10"/>
<CursorPos X="48" Y="238"/>
<TopLine Value="226"/>
<EditorIndex Value="1"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit15>
<Unit16>
<Filename Value="../../Units/MMLAddon/windowselector.pas"/>
<UnitName Value="windowselector"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="10"/>
<UsageCount Value="16"/>
<CursorPos X="1" Y="33"/>
<TopLine Value="12"/>
<EditorIndex Value="13"/>
<UsageCount Value="17"/>
<Loaded Value="True"/>
</Unit16>
<Unit17>
@ -181,150 +181,175 @@
<UnitName Value="Window"/>
<CursorPos X="94" Y="338"/>
<TopLine Value="323"/>
<EditorIndex Value="2"/>
<UsageCount Value="15"/>
<Loaded Value="True"/>
</Unit17>
<Unit18>
<Filename Value="../../Units/MMLCore/mufasatypes.pas"/>
<UnitName Value="MufasaTypes"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="277"/>
<EditorIndex Value="1"/>
<UsageCount Value="14"/>
<EditorIndex Value="5"/>
<UsageCount Value="15"/>
<Loaded Value="True"/>
</Unit18>
<Unit19>
<Filename Value="../../Units/MMLCore/fontloader.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="fontloader"/>
<CursorPos X="34" Y="121"/>
<CursorPos X="42" Y="106"/>
<TopLine Value="89"/>
<EditorIndex Value="7"/>
<UsageCount Value="22"/>
<EditorIndex Value="10"/>
<UsageCount Value="24"/>
<Loaded Value="True"/>
</Unit19>
<Unit20>
<Filename Value="../../Units/MMLCore/os_linux.pas"/>
<UnitName Value="os_linux"/>
<CursorPos X="48" Y="61"/>
<TopLine Value="37"/>
<EditorIndex Value="2"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit20>
<Unit21>
<Filename Value="../../Units/MMLCore/iomanager.pas"/>
<UnitName Value="IOManager"/>
<CursorPos X="87" Y="102"/>
<TopLine Value="227"/>
<EditorIndex Value="4"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit21>
<Unit22>
<Filename Value="../../Units/MMLCore/os_windows.pas"/>
<UnitName Value="os_windows"/>
<CursorPos X="65" Y="64"/>
<TopLine Value="45"/>
<EditorIndex Value="3"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit22>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="../../Units/MMLCore/ocr.pas"/>
<Caret Line="191" Column="50" TopLine="183"/>
<Filename Value="unit1.pas"/>
<Caret Line="11" Column="26" TopLine="1"/>
</Position1>
<Position2>
<Filename Value="unit1.pas"/>
<Caret Line="9" Column="66" TopLine="1"/>
<Caret Line="84" Column="26" TopLine="66"/>
</Position2>
<Position3>
<Filename Value="unit1.pas"/>
<Caret Line="34" Column="16" TopLine="1"/>
<Caret Line="87" Column="22" TopLine="69"/>
</Position3>
<Position4>
<Filename Value="unit1.pas"/>
<Caret Line="149" Column="13" TopLine="117"/>
<Filename Value="../../Units/MMLCore/os_linux.pas"/>
<Caret Line="73" Column="41" TopLine="55"/>
</Position4>
<Position5>
<Filename Value="unit1.pas"/>
<Caret Line="135" Column="69" TopLine="124"/>
<Caret Line="11" Column="24" TopLine="1"/>
</Position5>
<Position6>
<Filename Value="../../Units/MMLCore/ocr.pas"/>
<Caret Line="340" Column="78" TopLine="325"/>
<Filename Value="unit1.pas"/>
<Caret Line="91" Column="11" TopLine="71"/>
</Position6>
<Position7>
<Filename Value="../../Units/MMLCore/window.pas"/>
<Caret Line="62" Column="64" TopLine="46"/>
<Filename Value="../../Units/MMLCore/client.pas"/>
<Caret Line="48" Column="27" TopLine="30"/>
</Position7>
<Position8>
<Filename Value="unit1.pas"/>
<Caret Line="91" Column="43" TopLine="74"/>
<Filename Value="../../Units/MMLCore/os_linux.pas"/>
<Caret Line="69" Column="35" TopLine="51"/>
</Position8>
<Position9>
<Filename Value="unit1.pas"/>
<Caret Line="89" Column="13" TopLine="71"/>
<Filename Value="../../Units/MMLCore/os_linux.pas"/>
<Caret Line="41" Column="32" TopLine="34"/>
</Position9>
<Position10>
<Filename Value="../../Units/MMLCore/mufasatypesutil.pas"/>
<Caret Line="8" Column="25" TopLine="1"/>
<Filename Value="../../Units/MMLCore/iomanager.pas"/>
<Caret Line="66" Column="28" TopLine="45"/>
</Position10>
<Position11>
<Filename Value="../../Units/MMLCore/window.pas"/>
<Caret Line="71" Column="47" TopLine="51"/>
<Filename Value="unit1.pas"/>
<Caret Line="87" Column="6" TopLine="82"/>
</Position11>
<Position12>
<Filename Value="unit1.pas"/>
<Caret Line="91" Column="1" TopLine="67"/>
<Filename Value="../../Units/MMLCore/iomanager.pas"/>
<Caret Line="200" Column="37" TopLine="194"/>
</Position12>
<Position13>
<Filename Value="unit1.pas"/>
<Caret Line="85" Column="41" TopLine="66"/>
<Filename Value="../../Units/MMLCore/iomanager.pas"/>
<Caret Line="348" Column="85" TopLine="330"/>
</Position13>
<Position14>
<Filename Value="../../Units/MMLCore/fontloader.pas"/>
<Caret Line="46" Column="37" TopLine="16"/>
<Filename Value="../../Units/MMLCore/iomanager.pas"/>
<Caret Line="233" Column="33" TopLine="215"/>
</Position14>
<Position15>
<Filename Value="../../Units/MMLCore/fontloader.pas"/>
<Caret Line="40" Column="1" TopLine="16"/>
<Filename Value="../../Units/MMLCore/iomanager.pas"/>
<Caret Line="17" Column="73" TopLine="1"/>
</Position15>
<Position16>
<Filename Value="../../Units/MMLCore/fontloader.pas"/>
<Caret Line="54" Column="20" TopLine="23"/>
<Filename Value="../../Units/MMLCore/iomanager.pas"/>
<Caret Line="233" Column="33" TopLine="215"/>
</Position16>
<Position17>
<Filename Value="../../Units/MMLCore/fontloader.pas"/>
<Caret Line="59" Column="1" TopLine="25"/>
<Filename Value="../../Units/MMLCore/iomanager.pas"/>
<Caret Line="32" Column="16" TopLine="14"/>
</Position17>
<Position18>
<Filename Value="../../Units/MMLCore/fontloader.pas"/>
<Caret Line="63" Column="22" TopLine="28"/>
<Filename Value="../../Units/MMLCore/iomanager.pas"/>
<Caret Line="8" Column="99" TopLine="1"/>
</Position18>
<Position19>
<Filename Value="../../Units/MMLCore/fontloader.pas"/>
<Caret Line="60" Column="28" TopLine="31"/>
<Filename Value="unit1.pas"/>
<Caret Line="12" Column="56" TopLine="5"/>
</Position19>
<Position20>
<Filename Value="../../Units/MMLCore/fontloader.pas"/>
<Caret Line="79" Column="59" TopLine="58"/>
<Filename Value="unit1.pas"/>
<Caret Line="87" Column="29" TopLine="65"/>
</Position20>
<Position21>
<Filename Value="../../Units/MMLCore/fontloader.pas"/>
<Caret Line="101" Column="18" TopLine="71"/>
<Filename Value="unit1.pas"/>
<Caret Line="36" Column="18" TopLine="18"/>
</Position21>
<Position22>
<Filename Value="../../Units/MMLCore/fontloader.pas"/>
<Caret Line="65" Column="13" TopLine="56"/>
<Filename Value="../../Units/MMLCore/os_linux.pas"/>
<Caret Line="69" Column="34" TopLine="56"/>
</Position22>
<Position23>
<Filename Value="../../Units/MMLCore/fontloader.pas"/>
<Caret Line="128" Column="18" TopLine="100"/>
<Filename Value="unit1.pas"/>
<Caret Line="36" Column="18" TopLine="18"/>
</Position23>
<Position24>
<Filename Value="../../Units/MMLCore/ocrutil.pas"/>
<Caret Line="57" Column="21" TopLine="39"/>
<Filename Value="unit1.pas"/>
<Caret Line="87" Column="47" TopLine="70"/>
</Position24>
<Position25>
<Filename Value="../../Units/MMLCore/fontloader.pas"/>
<Caret Line="143" Column="16" TopLine="109"/>
<Filename Value="../../Units/MMLCore/iomanager.pas"/>
<Caret Line="226" Column="37" TopLine="196"/>
</Position25>
<Position26>
<Filename Value="../../Units/MMLCore/fontloader.pas"/>
<Caret Line="114" Column="30" TopLine="96"/>
<Filename Value="unit1.pas"/>
<Caret Line="87" Column="60" TopLine="69"/>
</Position26>
<Position27>
<Filename Value="../../Units/MMLCore/fontloader.pas"/>
<Caret Line="105" Column="14" TopLine="78"/>
<Filename Value="unit1.pas"/>
<Caret Line="95" Column="79" TopLine="70"/>
</Position27>
<Position28>
<Filename Value="../../Units/MMLCore/fontloader.pas"/>
<Caret Line="103" Column="9" TopLine="85"/>
<Filename Value="../../Units/MMLCore/os_linux.pas"/>
<Caret Line="191" Column="107" TopLine="170"/>
</Position28>
<Position29>
<Filename Value="../../Units/MMLCore/fontloader.pas"/>
<Caret Line="176" Column="56" TopLine="145"/>
<Filename Value="unit1.pas"/>
<Caret Line="10" Column="8" TopLine="1"/>
</Position29>
<Position30>
<Filename Value="unit1.pas"/>
<Caret Line="80" Column="59" TopLine="40"/>
<Filename Value="../../Units/MMLCore/os_windows.pas"/>
<Caret Line="167" Column="15" TopLine="144"/>
</Position30>
</JumpHistory>
</ProjectOptions>

View File

@ -6,7 +6,9 @@ interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls, ExtCtrls, Client, MufasaTypes, Bitmaps, ocr, windowselector,window;
StdCtrls, ExtCtrls, Client, MufasaTypes, Bitmaps, ocr, windowselector,
{$IFDEF MSWINDOWS} os_windows, {$ENDIF}
{$IFDEF LINUX} os_linux {$ENDIF};
type
@ -31,7 +33,7 @@ type
BitmapPath: String;
FontPath: String;
CliW: TMWindow;
CliW: TIOManager;
UseClient: Boolean;
{ private declarations }
public
@ -79,14 +81,14 @@ begin
Form1.Image1.Canvas.Rectangle(0, 0, Form1.Image1.Canvas.Width, Form1.Image1.Canvas.Height);
// create and init client
C := TClient.Create;
C := TClient.Create('');
bmp := TMufasaBitmap.Create;
if UseClient then
C.MWindow.SetWindow(CliW)
C.IOManager.SetTarget(TWindow(CliW.GetImageTarget).GetNativeWindow())
else
begin
bmp.LoadFromFile(BitmapPath);
C.MWindow.SetTarget(bmp);
C.IOManager.SetTarget(bmp);
end;
Shadow :=FShadow.Checked;
@ -158,7 +160,7 @@ Var
begin
UseClient := True;
if not assigned(CliW) then
CliW := TMWindow.Create;
CliW := TIOManager.Create;
WS := TMWindowSelector.Create(CliW);
CliW.SetTarget(WS.Drag{$IFDEF WINDOWS},w_Window{$ENDIF});
end;

View File

@ -222,7 +222,9 @@ interface
procedure PressKey(key: Word);
procedure SendText(text: string);
function isKeyDown(key: Word): Boolean;
function GetImageTarget: TTarget;
protected
keymouse: TTarget;
image: TTarget;
@ -231,6 +233,7 @@ interface
bothsame: boolean;
procedure SetImageTarget(target: TTarget);
procedure SetKeyMouseTarget(target: TTarget);
procedure SetBothTargets(target: TTarget);
procedure NativeInit; virtual; abstract;
@ -290,6 +293,12 @@ begin
image:= target;
bothsame:= false;
end;
function TIOManager_Abstract.GetImageTarget: TTarget;
begin
result := image;
end;
procedure TIOManager_Abstract.SetKeyMouseTarget(target: TTarget);
begin
if not(bothsame) then keymouse.Free();
@ -340,17 +349,34 @@ begin
result:= frozen <> nil;
end;
function TIOManager_Abstract.GetColor(x,y : integer) : TColor; begin result:= image.GetColor(x,y); end;
function TIOManager_Abstract.ReturnData(xs,ys,width,height: integer): TRetData; begin result:= image.ReturnData(xs,ys,width,height); end;
procedure TIOManager_Abstract.FreeReturnData; begin image.freeReturnData(); end;
function TIOManager_Abstract.GetColor(x,y : integer) : TColor;
begin
result:= image.GetColor(x,y);
end;
function TIOManager_Abstract.ReturnData(xs,ys,width,height: integer): TRetData;
begin
result:= image.ReturnData(xs,ys,width,height);
end;
procedure TIOManager_Abstract.FreeReturnData;
begin
image.freeReturnData();
end;
function TIOManager_Abstract.SetTarget(ArrPtr: PRGB32; Size: TPoint): integer;
begin
SetImageTarget(TRawTarget.Create(ArrPtr,Size.X,Size.Y));
end;
function TIOManager_Abstract.SetTarget(bmp : TMufasaBitmap) : integer;
begin
SetImageTarget(TRawTarget.Create(bmp.FData,bmp.width,bmp.height));
end;
function TIOManager_Abstract.SetTarget(ArrPtr: PRGB32; Size: TPoint): integer; begin SetImageTarget(TRawTarget.Create(ArrPtr,Size.X,Size.Y)); end;
function TIOManager_Abstract.SetTarget(bmp : TMufasaBitmap) : integer; begin SetImageTarget(TRawTarget.Create(bmp.FData,bmp.width,bmp.height)); end;
function TIOManager_Abstract.SetTarget(name: string; initargs: pointer): integer;
var
client: TEIOS_Client;
begin
if not eios_controller.ClientExists(name) then raise Exception.Create('EIOS Client by specified name does not exist');
if not eios_controller.ClientExists(name) then
raise Exception.Create('EIOS Client by specified name does not exist');
client:= eios_controller.GetClient(name);
SetBothTargets(TEIOS_Target.Create(client, initargs));
end;
@ -369,10 +395,23 @@ begin
{not sure if image needs activation or not, if its a native window keymouse == image so it should be good.}
end;
procedure TIOManager_Abstract.GetMousePos(var X, Y: Integer); begin keymouse.GetMousePosition(x,y) end;
procedure TIOManager_Abstract.SetMousePos(X, Y: Integer); begin keymouse.MoveMouse(x,y); end;
procedure TIOManager_Abstract.HoldMouse(x,y : integer; button: TClickType); begin keymouse.HoldMouse(x,y,button); end;
procedure TIOManager_Abstract.ReleaseMouse(x,y : integer; button: TClickType); begin keymouse.ReleaseMouse(x,y,button); end;
procedure TIOManager_Abstract.GetMousePos(var X, Y: Integer);
begin
keymouse.GetMousePosition(x,y)
end;
procedure TIOManager_Abstract.SetMousePos(X, Y: Integer);
begin
keymouse.MoveMouse(x,y);
end;
procedure TIOManager_Abstract.HoldMouse(x,y : integer; button: TClickType);
begin
keymouse.HoldMouse(x,y,button);
end;
procedure TIOManager_Abstract.ReleaseMouse(x,y : integer; button: TClickType);
begin
keymouse.ReleaseMouse(x,y,button);
end;
procedure TIOManager_Abstract.ClickMouse(X, Y: Integer; button: TClickType);
begin
HoldMouse(x,y,button);
@ -380,11 +419,28 @@ begin
ReleaseMouse(x,y,button);
end;
procedure TIOManager_Abstract.KeyUp(key: Word); begin keymouse.ReleaseKey(key) end;
procedure TIOManager_Abstract.KeyDown(key: Word); begin keymouse.HoldKey(key) end;
procedure TIOManager_Abstract.PressKey(key: Word); begin keyup(key); keydown(key); end;
procedure TIOManager_Abstract.SendText(text: string); begin keymouse.SendString(text); end;
function TIOManager_Abstract.isKeyDown(key: Word): Boolean; begin result:= keymouse.IsKeyHeld(key); end;
procedure TIOManager_Abstract.KeyUp(key: Word);
begin
keymouse.ReleaseKey(key)
end;
procedure TIOManager_Abstract.KeyDown(key: Word);
begin
keymouse.HoldKey(key)
end;
procedure TIOManager_Abstract.PressKey(key: Word);
begin
keyup(key);
keydown(key);
end;
procedure TIOManager_Abstract.SendText(text: string);
begin
keymouse.SendString(text);
end;
function TIOManager_Abstract.isKeyDown(key: Word): Boolean;
begin
result:= keymouse.IsKeyHeld(key);
end;
//***implementation*** TTarget

View File

@ -54,7 +54,7 @@ uses
procedure FilterShadowBitmap(bmp: TMufasaBitmap);
procedure FilterCharsBitmap(bmp: TMufasaBitmap);
function GetTextAt(atX, atY, font, minspacing, maxspacing, color, len: integer): string;
function GetTextAt(atX, atY, minspacing, maxspacing, color, tol, len: integer; font: string): string;
function TextToFontTPA(Text, font: String; var w, h: integer): TPointArray;
function TextToFontBitmap(Text, font: String): TMufasaBitmap;
function TextToMask(Text, font: String): TMask;
@ -704,9 +704,17 @@ begin
result := GetUpTextAtEx(atX, atY, false);
end;
function TMOCR.GetTextAt(atX, atY, font, minspacing, maxspacing, color, len: integer): string;
function TMOCR.GetTextAt(atX, atY, minspacing, maxspacing, color, tol, len: integer; font: string): string;
var
fD: TocrData;
TPA: TPointArray;
begin
fD := Fonts.GetFont(font);
SetLength(TPA, 0);
TClient(Client).MFinder.FindColorsTolerance(TPA, color, atX, atY, {fuck}0, {fuck}0, tol);
end;

View File

@ -57,6 +57,8 @@ interface
procedure HoldKey(key: integer); override;
procedure ReleaseKey(key: integer); override;
function IsKeyHeld(key: integer): boolean; override;
function GetNativeWindow: x.TWindow;
private
display: PDisplay;
screennum: integer;
@ -131,7 +133,12 @@ implementation
keyinput.Free;
inherited Destroy;
end;
function TWindow.GetNativeWindow: x.TWindow;
begin
result := self.window;
end;
procedure TWindow.GetTargetDimensions(var w, h: integer);
var
Old_Handler: TXErrorHandler;

View File

@ -58,6 +58,8 @@ interface
procedure HoldKey(key: integer); override;
procedure ReleaseKey(key: integer); override;
function IsKeyHeld(key: integer): boolean; override;
function GetNativeWindow: Hwnd;
private
handle: Hwnd;
dc: HDC;
@ -160,6 +162,11 @@ implementation
inherited Destroy;
end;
function TWindow.GetNativeWindow: Hwnd;
begin
result := handle;
end;
function TWindow.TargetValid: boolean;
begin
result:= IsWindow(handle);