www.pudn.com > 屏幕取词完全实现代码.rar > untTypes.pas


(******************************************************************************* 
* Copy Right (C) Gan Huaxin 2001, 2002, huiyugan@263.net 
* A Free Screen Words Capture Library 
*   Dedicated to my GirlFriend Sunny, Happy for ever 
*  
* Version         Date           Modification 
*   0.1       2001-11-07~09       New, oly a test 
*                                 Can Get Word, Sometimes occure error 
*   0.2       2002-05-14~16       Some Bugs Fixed,And 
*******************************************************************************) 
unit untTypes; 
 
interface 
 
uses 
  Windows; 
 
type 
  TCommonData = record 
    bCapture : BOOL; 
    bInSpec : BOOL; 
    CallBackHandle:HWnd; 
    CallBackProcID : DWORD; 
    hWndFloat : HWnd; (*浮动窗口的句柄*) 
    hWndMouse : HWnd; (*鼠标所在窗口server的句柄*) 
    hWndCapture : HWnd; (*当前鼠标所在的窗口*) 
    MousePos  : TPoint; (*当前鼠标屏幕坐标*) 
    MousePClient : TPoint; (*鼠标所在窗口的坐标*) 
    Rect : TRect; 
    case integer of 
      0 : (BufferA : array [0..1023] of Char); 
      1 : (BufferW : array [0..511] of WideChar); 
  end; 
 
 
  PCommonData = ^TCommonData; 
 
  TCode5 = packed record 
    siJmp : ShortInt; 
    dwAddr : DWORD; 
  end; 
 
  TThunkFunc = (tfTextOutA,       tfTextOutW, 
                tfExtTextOutA,    tfExtTextOutW, 
                tfDrawTextA,      tfDrawTextW); 
 
  TThunkFuncName = packed record 
    strMod        : string;  // 系统模块名称 
    strSysProc    : string;  // 系统DLL中的名字 
    strThunkProc  : string;  // 你替换的函数的名字,必须在DLL的引出表中 
  end; 
 
  TThunkCode = packed record 
    codeBak       : TCode5;  // 系统函数的代码的前5个字节 
    codeThunk     : TCode5;  // 跳转到你的代码的5个字节 
    addr_sys      : Pointer; // 系统函数的地址 
    addr_thunk    : Pointer; // 替换函数的地址 
    bInstalled    : boolean; // 安装了吗? 
  end; 
 
const 
  G_DELAY_TIME = 100; 
 
const 
  ThunkFuncNameArr : array[TThunkFunc] of TThunkFuncName = ( 
    (strMod : 'gdi32.dll';  strSysProc : 'TextOutA';    strThunkProc : 'GanTextOutA'), 
    (strMod : 'gdi32.dll';  strSysProc : 'TextOutW';    strThunkProc : 'GanTextOutW'), 
    (strMod : 'gdi32.dll';  strSysProc : 'ExtTextOutA'; strThunkProc : 'GanExtTextOutA'), 
    (strMod : 'gdi32.dll';  strSysProc : 'ExtTextOutW'; strThunkProc : 'GanExtTextOutW'), 
    (strMod : 'user32.dll'; strSysProc : 'DrawTextA';   strThunkProc : 'GanDrawTextA'), 
    (strMod : 'user32.dll'; strSysProc : 'DrawTextW';   strThunkProc : 'GanDrawTextW') 
  ); 
 
 
implementation 
 
end.