谁有屏幕取词的delphi源代码,我头发都急白了(800里加急),收到源码再送100分 (50分)

  • 主题发起人 主题发起人 yfdciom
  • 开始时间 开始时间
huiyugan,在没得到你的同意的情况下,我不能公布你的源代码;<br>待我研究之后,决不失言。<br>我有不懂之处,还请帮助之。
 
to yfdciom<br>我也有源代码!!!!:)
 
to yfdciom<br>把源代码发给你,希望对你有所帮助!!!收到后不要忘了告诉我!!
 
&nbsp;鉴于经常在网上看到有很多人研究屏幕取词,索要代码,我想把我写的一个屏幕取词的雏形<br>奉献给需要的人,也许这份代码在很多高手看来嗤之以鼻,但我这个人不怕献丑,希望能得<br>到高手的斧正。<br>&nbsp; &nbsp; 在网上我们经常能够看到一些实现,但是并没有看到完全的delphi实现,经常是dll是其他<br>写的或者没有源代码。我们经常看到的都是被人说了1千遍的所谓实现机制。<br>&nbsp; &nbsp; 声明:此代码是我慢慢试验一步一步写出来的,所以代码很乱,希望大家不要对此作过多批<br>评,此外其功能并没有完全实现,比如IE下的取词,取词的分析,我说过只是雏形。<br>&nbsp; &nbsp; 关于重画,贴出来的代码中使用了显示一个窗口然后隐藏,其实可以用InvalidataRect,再<br>发重画消息。<br>&nbsp; &nbsp; 代码只是在2000下能用,稍作改动可以用于98。<br>&nbsp; &nbsp; 如转载请注明原作者。<br>&nbsp; &nbsp; 如有讨论者可以在此论坛,也可以通过huiyugan@263.net甘化新联系。<br>&nbsp; &nbsp; 代码大概有一千多行,我不知道能够正常贴上。<br>&nbsp;<br>&nbsp;<br>来自:huiyugan, 时间:2002-5-25 13:39:00, ID:1123363 <br>单元untTypes.pas<br><br>(*******************************************************************************<br>* Copy Right (C) Gan Huaxin 2001, 2002, huiyugan@263.net<br>* A Free Screen Words Capture Library<br>* &nbsp; Dedicated to my GirlFriend Sunny, Happy for ever<br>* <br>* Version &nbsp; &nbsp; &nbsp; &nbsp; Date &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Modification<br>* &nbsp; 0.1 &nbsp; &nbsp; &nbsp; 2001-11-07~09 &nbsp; &nbsp; &nbsp; New, oly a test<br>* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Can Get Word, Sometimes occure error<br>* &nbsp; 0.2 &nbsp; &nbsp; &nbsp; 2002-05-14~16 &nbsp; &nbsp; &nbsp; Some Bugs Fixed,And<br>*******************************************************************************)<br>unit untTypes;<br><br>interface<br><br>uses<br>&nbsp; Windows;<br><br>type<br>&nbsp; TCommonData = record<br>&nbsp; &nbsp; bCapture : BOOL;<br>&nbsp; &nbsp; bInSpec : BOOL;<br>&nbsp; &nbsp; CallBackHandle:HWnd;<br>&nbsp; &nbsp; CallBackProcID : DWORD;<br>&nbsp; &nbsp; hWndFloat : HWnd; (*浮动窗口的句柄*)<br>&nbsp; &nbsp; hWndMouse : HWnd; (*鼠标所在窗口server的句柄*)<br>&nbsp; &nbsp; hWndCapture : HWnd; (*当前鼠标所在的窗口*)<br>&nbsp; &nbsp; MousePos &nbsp;: TPoint; (*当前鼠标屏幕坐标*)<br>&nbsp; &nbsp; MousePClient : TPoint; (*鼠标所在窗口的坐标*)<br>&nbsp; &nbsp; Rect : TRect;<br>&nbsp; &nbsp; case integer of<br>&nbsp; &nbsp; &nbsp; 0 : (BufferA : array [0..1023] of Char);<br>&nbsp; &nbsp; &nbsp; 1 : (BufferW : array [0..511] of WideChar);<br>&nbsp; end;<br><br><br>&nbsp; PCommonData = ^TCommonData;<br><br>&nbsp; TCode5 = packed record<br>&nbsp; &nbsp; siJmp : ShortInt;<br>&nbsp; &nbsp; dwAddr : DWORD;<br>&nbsp; end;<br><br>&nbsp; TThunkFunc = (tfTextOutA, &nbsp; &nbsp; &nbsp; tfTextOutW,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tfExtTextOutA, &nbsp; &nbsp;tfExtTextOutW,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tfDrawTextA, &nbsp; &nbsp; &nbsp;tfDrawTextW);<br><br>&nbsp; TThunkFuncName = packed record<br>&nbsp; &nbsp; strMod &nbsp; &nbsp; &nbsp; &nbsp;: string; &nbsp;// 系统模块名称<br>&nbsp; &nbsp; strSysProc &nbsp; &nbsp;: string; &nbsp;// 系统DLL中的名字<br>&nbsp; &nbsp; strThunkProc &nbsp;: string; &nbsp;// 你替换的函数的名字,必须在DLL的引出表中<br>&nbsp; end;<br><br>&nbsp; TThunkCode = packed record<br>&nbsp; &nbsp; codeBak &nbsp; &nbsp; &nbsp; : TCode5; &nbsp;// 系统函数的代码的前5个字节<br>&nbsp; &nbsp; codeThunk &nbsp; &nbsp; : TCode5; &nbsp;// 跳转到你的代码的5个字节<br>&nbsp; &nbsp; addr_sys &nbsp; &nbsp; &nbsp;: Pointer; // 系统函数的地址<br>&nbsp; &nbsp; addr_thunk &nbsp; &nbsp;: Pointer; // 替换函数的地址<br>&nbsp; &nbsp; bInstalled &nbsp; &nbsp;: boolean; // 安装了吗?<br>&nbsp; end;<br><br>const<br>&nbsp; G_DELAY_TIME = 100;<br><br>const<br>&nbsp; ThunkFuncNameArr : array[TThunkFunc] of TThunkFuncName = (<br>&nbsp; &nbsp; (strMod : 'gdi32.dll'; &nbsp;strSysProc : 'TextOutA'; &nbsp; &nbsp;strThunkProc : 'GanTextOutA'),<br>&nbsp; &nbsp; (strMod : 'gdi32.dll'; &nbsp;strSysProc : 'TextOutW'; &nbsp; &nbsp;strThunkProc : 'GanTextOutW'),<br>&nbsp; &nbsp; (strMod : 'gdi32.dll'; &nbsp;strSysProc : 'ExtTextOutA'; strThunkProc : 'GanExtTextOutA'),<br>&nbsp; &nbsp; (strMod : 'gdi32.dll'; &nbsp;strSysProc : 'ExtTextOutW'; strThunkProc : 'GanExtTextOutW'),<br>&nbsp; &nbsp; (strMod : 'user32.dll'; strSysProc : 'DrawTextA'; &nbsp; strThunkProc : 'GanDrawTextA'),<br>&nbsp; &nbsp; (strMod : 'user32.dll'; strSysProc : 'DrawTextW'; &nbsp; strThunkProc : 'GanDrawTextW')<br>&nbsp; );<br><br><br>implementation<br><br>end.<br>&nbsp;<br>&nbsp;<br>来自:huiyugan, 时间:2002-5-25 13:41:00, ID:1123366 <br>链接库 GFDict.dll的代码,GFDict.dpr<br>(*******************************************************************************<br>* Copy Right (C) Gan Huaxin 2001, 2002, huiyugan@263.net<br>* A Free Screen Words Capture Library<br>* &nbsp; Dedicated to my GirlFriend Sunny, Happy for ever<br>* <br>* Version &nbsp; &nbsp; &nbsp; &nbsp; Date &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Modification<br>* &nbsp; 0.1 &nbsp; &nbsp; &nbsp; 2001-11-07~09 &nbsp; &nbsp; &nbsp; New, oly a test<br>* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Can Get Word, Sometimes occure error<br>* &nbsp; 0.2 &nbsp; &nbsp; &nbsp; 2002-05-14~16 &nbsp; &nbsp; &nbsp; Some Bugs Fixed,And<br>*******************************************************************************)<br>library GFDict;<br><br>// {$DEFINE MSG_NOT_SEND}<br>{$DEFINE WIN_NT}<br><br>{$IFNDEF WIN_NT}<br>&nbsp; {$DEFINE WIN_9X}<br>{$ENDIF}<br><br>// {$DEFINE DEBUG}<br><br><br>uses<br>&nbsp; SysUtils,<br>&nbsp; Classes,<br>&nbsp; windows,<br>&nbsp; messages,<br>&nbsp; untTypes;<br><br>const<br>&nbsp; STR_MSGNOTIFY:PChar='WM_GANNOTIFY';<br><br>var<br>&nbsp; HMapFile:THandle;<br>&nbsp; CommonData:^TCommonData;<br>&nbsp; idMsg : UINT;<br>&nbsp; hwndServer : HWnd;<br><br>var<br>&nbsp; hWndCover : THandle;<br>&nbsp; LastMousePos : TPoint;<br>&nbsp; LastTime : DWORD;<br>&nbsp; g_CriticalSection : TRTLCriticalSection;<br>&nbsp; m_CriticalSection : TRTLCriticalSection;<br>&nbsp; b_InCS : boolean;<br><br>var<br>&nbsp; hNextHookProc: HHook;<br>&nbsp; hProc : THandle;<br>&nbsp; bFirst : boolean;<br>&nbsp; bDllInstalled : boolean;<br>&nbsp; ThunkCodeArr : array[TThunkFunc] of TThunkCode;<br><br>{$IFDEF DEBUG}<br>&nbsp; procedure GanWarning;<br>&nbsp; begin<br>&nbsp; &nbsp; MessageBeep(0);<br>&nbsp; end;<br>{$ELSE}<br>&nbsp; procedure GanWarning;<br>&nbsp; begin<br>&nbsp; end;<br>{$ENDIF}<br><br>{$DEFINE _NOTIFY_}<br><br>{$IFDEF _NOTIFY_}<br>&nbsp; procedure GanNotify;<br>&nbsp; begin<br>&nbsp; &nbsp; MessageBeep(0);<br>&nbsp; end;<br>{$ELSE}<br>&nbsp; procedure GanNotify;<br>&nbsp; begin<br>&nbsp; end;<br>{$ENDIF}<br><br><br>// about Memory Map file support<br>procedure MapCommonData;<br>var FirstCall: Boolean;<br>begin<br>&nbsp; HMapFile:=OpenFileMapping(FILE_MAP_WRITE, False, 'GanGan_ThunkDict');<br>&nbsp; FirstCall:=(HMapFile = 0);<br>&nbsp; if FirstCall then<br>&nbsp; &nbsp; HMapFile:=CreateFileMapping($FFFFFFFF,nil,PAGE_READWRITE,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0,SizeOf(TCommonData),<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'GanGan_ThunkDict');<br>&nbsp; CommonData:= MapViewOfFile(HMapFile, FILE_MAP_WRITE, 0, 0, 0);<br>&nbsp; if FirstCall then FillChar(CommonData^, SizeOf(TCommonData), 0);<br>end;<br><br>// -----------------------------------------------------------------------------<br>procedure UnInstallThunkFunc(tfType : TThunkFunc);<br>var<br>&nbsp; nCount : DWORD;<br>begin<br>&nbsp; if not ThunkCodeArr[tfType].bInstalled then exit;<br>&nbsp; if (hProc=0) or (ThunkCodeArr[tfType].addr_sys=nil) then exit;<br>&nbsp; WriteProcessMemory(hProc,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ThunkCodeArr[tfType].addr_sys,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;@(ThunkCodeArr[tfType].codeBak),<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nCount);<br>&nbsp; ThunkCodeArr[tfType].bInstalled := false;<br>end;<br><br>procedure InstallThunkFunc(tfType : TThunkFunc);<br>var<br>&nbsp; nCount : DWORD;<br>begin<br>&nbsp; if ThunkCodeArr[tfType].bInstalled then exit;<br>&nbsp; if (hProc=0) or (ThunkCodeArr[tfType].addr_sys=nil) then exit;<br>&nbsp; WriteProcessMemory(hProc,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ThunkCodeArr[tfType].addr_sys,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;@(ThunkCodeArr[tfType].codeThunk),<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nCount);<br>&nbsp; ThunkCodeArr[tfType].bInstalled := True;<br>end;<br><br>procedure UnInstallGanFilter; forward;<br><br>{=================== &nbsp;TextOut &nbsp; ==============================================}<br>function GanTextOutA(DC: HDC; X, Y: Integer; Str: PAnsiChar; Count: Integer): BOOL; stdcall;<br>var<br>&nbsp; tm : TTextMetric;<br>&nbsp; rect : TRect;<br>&nbsp; size : TSize;<br>&nbsp; i, j : integer;<br>&nbsp; posDcOrg : TPoint;<br>&nbsp; posDcOff : TPoint;<br>begin<br>// &nbsp;EnterCriticalSection(g_CriticalSection);<br><br>&nbsp; result := FALSE;<br>&nbsp; UnInstallThunkFunc(tfTextOutA);<br>{$IFNDEF MSG_NOT_SEND}<br>try<br>&nbsp; if (CommonData&lt;&gt;nil) then begin<br>&nbsp; &nbsp; GetDcOrgEx(dc, posDcOrg); // Get The DC offset<br>&nbsp; &nbsp; posDcOff := Point(x,y);<br>&nbsp; &nbsp; LPtoDP(dc, posDcOff, 1);<br><br>&nbsp; &nbsp; Rect.Left := posDcOrg.x + posDcOff.x;<br>&nbsp; &nbsp; Rect.Top := posDcOrg.y + posDcOff.y;<br><br>&nbsp; &nbsp; if BOOL(GetTextAlign(dc) and &nbsp;TA_UPDATECP) then begin<br>&nbsp; &nbsp; &nbsp; GetCurrentPositionEx(dc, @posDcOff);<br>&nbsp; &nbsp; &nbsp; Inc(Rect.Left, posDcOff.x);<br>&nbsp; &nbsp; &nbsp; Inc(Rect.Top, posDcOff.y);<br>&nbsp; &nbsp; end;<br><br>&nbsp; &nbsp; GetTextExtentPointA(DC, Str, Count, size);<br><br>&nbsp; &nbsp; Rect.Right := &nbsp;Rect.Left + size.cx;<br>&nbsp; &nbsp; Rect.Bottom := Rect.Top + size.cy;<br><br>&nbsp; &nbsp; if PtInRect(rect, CommonData.MousePos) then begin // in total area!<br>&nbsp; &nbsp; &nbsp; if StrPos(Str, ' ')&lt;&gt;nil then begin<br>&nbsp; &nbsp; &nbsp; &nbsp; i := 0;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; while (Str = Char(' ')) and (i&lt;Count) do Inc(i);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; j := i;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; while (i&lt;Count) do begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if Str=Char(' ') then begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Str := Char(0);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GetTextExtentPointA(DC, Str, i-1, size);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rect.Right := rect.Left + size.cx;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if PtInRect(rect, CommonData.MousePos) then begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // SendMessage(CommonData.CallBackHandle, idMsg, i, 3);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; StrCopy(CommonData.BufferA, PChar(@(Str[j])));<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CommonData^.Rect := Rect;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SendMessage(CommonData^.CallBackHandle, idMsg, Integer(tfTextOutA), 0);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Str := Char(' ');<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Str := Char(' ');<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (Str = Char(' ')) and (i &lt; Count) do Inc(i);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if i=Count then break;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; j := i;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Dec(i);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // break;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; inc(i);<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; &nbsp; if (i=Count) then begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; StrCopy(CommonData.BufferA, PChar(@(Str[j])));<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CommonData^.Rect := Rect;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SendMessage(CommonData^.CallBackHandle, idMsg, Integer(tfTextOutA), 0);<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; end else<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; StrCopy(CommonData.BufferA, Str);<br>&nbsp; &nbsp; &nbsp; &nbsp; CommonData^.Rect := Rect;<br>&nbsp; &nbsp; &nbsp; &nbsp; SendMessage(CommonData^.CallBackHandle, idMsg, Integer(tfTextOutA), 0);<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; end;<br>&nbsp; end;<br>&nbsp; (*<br>&nbsp; StrCopy(CommonData.BufferA, Str);<br>&nbsp; CommonData^.Rect := Rect;<br>&nbsp; SendMessage(CommonData^.CallBackHandle, idMsg, Integer(tfTextOutA), 0);<br>&nbsp; *)<br>except<br>&nbsp; GanWarning;<br>&nbsp; StrCopy(CommonData.BufferA, 'Error in TextOutA');<br>&nbsp; SendMessage(CommonData^.CallBackHandle, idMsg, Integer(tfTextOutA), 0);<br>end;<br>{$ENDIF}<br>&nbsp; TextOutA(DC, X, Y, Str, Count);<br>&nbsp; InstallThunkFunc(tfTextOutA);<br>// &nbsp;UnInstallGanFilter;<br><br>// &nbsp;LeaveCriticalSection(g_CriticalSection);<br>end;<br><br>function GanTextOutW(DC: HDC; X, Y: Integer; Str: PWideChar; Count: Integer): BOOL; stdcall;<br>var<br>&nbsp; tm : TTextMetric;<br>&nbsp; rect : TRect;<br>&nbsp; size : TSize;<br>&nbsp; i, j : integer;<br>&nbsp; wChar : WideChar;<br>&nbsp; posDcOrg, posDcOff : TPoint;<br>begin<br>// &nbsp;EnterCriticalSection(g_CriticalSection);<br><br>&nbsp; result := FALSE;<br>&nbsp; UnInstallThunkFunc(tfTextOutW);<br>{$IFNDEF MSG_NOT_SEND}<br>try<br>&nbsp; if (CommonData&lt;&gt;nil) then begin<br>&nbsp; &nbsp; GetDcOrgEx(dc, posDcOrg);<br>&nbsp; &nbsp; posDcOff := Point(x,y);<br>&nbsp; &nbsp; LPtoDP(dc, posDcOff, 1);<br><br>&nbsp; &nbsp; Rect.Left := posDcOrg.x + posDcOff.x;<br>&nbsp; &nbsp; Rect.Top := posDcOrg.y + posDcOff.y;<br><br>&nbsp; &nbsp; if BOOL(GetTextAlign(dc) and &nbsp;TA_UPDATECP) then begin<br>&nbsp; &nbsp; &nbsp; GetCurrentPositionEx(dc, @posDcOff);<br>&nbsp; &nbsp; &nbsp; Inc(Rect.Left, posDcOff.x);<br>&nbsp; &nbsp; &nbsp; Inc(Rect.Top, posDcOff.y);<br>&nbsp; &nbsp; end;<br><br>&nbsp; &nbsp; GetTextExtentPointW(DC, Str, Count, size);<br><br>&nbsp; &nbsp; rect.Right := rect.Left + size.cx;<br>&nbsp; &nbsp; rect.Bottom := rect.Top + size.cy;<br><br>&nbsp; &nbsp; if PtInRect(rect, CommonData.MousePos) then begin<br>&nbsp; &nbsp; &nbsp; if StrPos(PChar(WideCharToString(Str)), ' ')&lt;&gt;nil then begin<br>&nbsp; &nbsp; &nbsp; &nbsp; i := 0;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; while (Str = WideChar(' ')) and (i&lt;Count) do Inc(i);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; j := i;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; while (i&lt;Count) do begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if Str=WideChar(' ') then begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Str := WideChar(0);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GetTextExtentPoint32W(DC, Str, i-1, size);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rect.Right := rect.Left + size.cx;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if PtInRect(rect, CommonData.MousePos) then begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // SendMessage(CommonData.CallBackHandle, idMsg, i, 3);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; StrCopy(CommonData.BufferA,PChar(WideCharToString(@(Str[j]))));<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CommonData^.Rect := Rect;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SendMessage(CommonData^.CallBackHandle, idMsg, Integer(tfTextOutW), 0);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Str := WideChar(' ');<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Str := WideChar(' ');<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (Str = WideChar(' ')) and (i &lt; Count) do Inc(i);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if i=Count then break;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; j := i;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Dec(i);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // break;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; inc(i);<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; &nbsp; if (i=Count) then begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; StrCopy(CommonData.BufferA, PChar(WideCharToString(@(Str[j]))));<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CommonData^.Rect := Rect;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SendMessage(CommonData^.CallBackHandle, idMsg, Integer(tfTextOutW), 0);<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; end else<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; StrCopy(CommonData.BufferA,PChar(WideCharToString(Str)));<br>&nbsp; &nbsp; &nbsp; &nbsp; CommonData^.Rect := Rect;<br>&nbsp; &nbsp; &nbsp; &nbsp; SendMessage(CommonData^.CallBackHandle, idMsg, Integer(tfTextOutW), 0);<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; end;<br>&nbsp; end;<br>except<br>&nbsp; GanWarning;<br>&nbsp; StrCopy(CommonData.BufferA, 'Error in TextOutW');<br>&nbsp; SendMessage(CommonData^.CallBackHandle, idMsg, Integer(tfTextOutW), 0);<br>end;<br>{$ENDIF}<br>&nbsp; result := TextOutW(DC, X, Y, Str, Count);<br>&nbsp; InstallThunkFunc(tfTextOutW);<br>// &nbsp;UnInstallGanFilter;<br><br>// &nbsp;LeaveCriticalSection(g_CriticalSection);<br>end;<br><br>{=================== &nbsp;ExtTextOut &nbsp;============================================}<br>(*<br>&nbsp; 这个函数在UltraEdit里会出错,加上异常处理就没有关系。<br>&nbsp; Bug Fixed 2002-05-13<br>*)<br>function GanExtTextOutA(DC: HDC; X, Y: Integer; Options: Longint;<br>&nbsp; Rect: PRect; Str: PAnsiChar; Count: Longint; Dx: PInteger): BOOL; stdcall;<br>var<br>&nbsp; posDcOrg : TPoint;<br>&nbsp; posDc : TPoint;<br>&nbsp; RectText : TRect;<br>&nbsp; size : TSize;<br>begin<br>// &nbsp;EnterCriticalSection(g_CriticalSection);<br><br>&nbsp; result := FALSE;<br>&nbsp; UnInstallThunkFunc(tfExtTextOutA);<br>{$IFNDEF MSG_NOT_SEND}<br><br>&nbsp; GetDcOrgEx(dc, posDcOrg);<br>&nbsp; posDc := Point(x,y);<br>&nbsp; LPtoDP(dc, posDc, 1);<br><br>&nbsp; RectText.Left := posDc.x + posDcOrg.x;<br>&nbsp; RectText.Top := posDc.y + posDcOrg.y;<br><br>&nbsp; if BOOL(GetTextAlign(dc) and TA_UPDATECP) then begin<br>&nbsp; &nbsp; GetCurrentPositionEx(dc, @posDc);<br>&nbsp; &nbsp; Inc(RectText.Left, posDc.x);<br>&nbsp; &nbsp; Inc(RectText.Top, posDc.y);<br>&nbsp; end;<br><br>&nbsp; GetTextExtentPointA(dc, Str, Count, size); {Get The Length and Height of str}<br>&nbsp; with RectText do begin<br>&nbsp; &nbsp; Right := Left + size.cx;<br>&nbsp; &nbsp; Bottom := Top + Size.cy;<br>&nbsp; end;<br>&nbsp; <br>&nbsp; if (CommonData&lt;&gt;nil) {and false} and PtInRect(RectText, CommonData.MousePos) then begin<br>&nbsp; &nbsp; try<br>&nbsp; &nbsp; &nbsp; StrCopy(CommonData.BufferA, Str);<br>&nbsp; &nbsp; &nbsp; CommonData^.Rect := RectText;<br>&nbsp; &nbsp; except<br>&nbsp; &nbsp; &nbsp; GanWarning;<br>&nbsp; &nbsp; &nbsp; StrCopy(CommonData.BufferA, 'ERROR in ExtTextOutA');<br>&nbsp; &nbsp; end;<br>&nbsp; &nbsp; SendMessage(CommonData^.CallBackHandle, idMsg, Integer(tfExtTextOutA), 0);<br>&nbsp; end;<br>{$ENDIF}<br>&nbsp; result := ExtTextOutA(DC, X, Y, Options, Rect, Str, Count, Dx);<br>&nbsp; InstallThunkFunc(tfExtTextOutA);<br>// &nbsp;UnInstallGanFilter;<br><br>// &nbsp;LeaveCriticalSection(g_CriticalSection);<br>end;<br><br>function GanExtTextOutW(DC: HDC; X, Y: Integer; Options: Longint;<br>&nbsp; Rect: PRect; Str: PWideChar; Count: Longint; Dx: PInteger): BOOL; stdcall;<br>var<br>&nbsp; posDcOrg : TPoint;<br>&nbsp; posDc : TPoint;<br>&nbsp; RectText : TRect;<br>&nbsp; size : TSize;<br>label last;<br>begin<br>// &nbsp;EnterCriticalSection(g_CriticalSection);<br>&nbsp; result := FALSE;<br>&nbsp; UnInstallThunkFunc(tfExtTextOutW);<br>{$IFNDEF MSG_NOT_SEND}<br>&nbsp; if CommonData^.bInSpec then begin<br>&nbsp; &nbsp; (*if (Options and ETO_CLIPPED)=0 then goto last;*)<br>&nbsp; &nbsp; try<br>&nbsp; &nbsp; &nbsp; &nbsp; StrCopy(CommonData.BufferA,PChar(WideCharToString(Str)));<br>&nbsp; &nbsp; &nbsp; &nbsp; CommonData^.Rect := RectText;<br>&nbsp; &nbsp; except<br>&nbsp; &nbsp; &nbsp; &nbsp; GanWarning;<br>&nbsp; &nbsp; &nbsp; &nbsp; StrCopy(CommonData.BufferA, 'ERROR in ExtTextOutW');<br>&nbsp; &nbsp; end;<br>&nbsp; &nbsp; SendMessage(CommonData^.CallBackHandle, idMsg, Integer(tfExtTextOutW), 0);<br>&nbsp; &nbsp; goto last;<br>&nbsp; end;<br><br>&nbsp; GetDcOrgEx(dc, posDcOrg);<br>&nbsp; posDc.x := x;<br>&nbsp; posDc.y := y;<br><br>&nbsp; LPtoDP(dc, posDc, 1);<br><br>&nbsp; RectText.Left := posDc.x + posDcOrg.x;<br>&nbsp; RectText.Top := posDc.y + posDcOrg.y;<br><br><br><br>&nbsp; if BOOL(GetTextAlign(dc) and TA_UPDATECP) then begin<br>&nbsp; &nbsp; GetCurrentPositionEx(dc, @posDc);<br>&nbsp; &nbsp; Inc(RectText.Left, posDc.x);<br>&nbsp; &nbsp; Inc(RectText.Top, posDc.y);<br>&nbsp; end;<br><br>&nbsp; GetTextExtentPointW(dc, Str, Count, size); {Get The Length and Height of str}<br>&nbsp; with RectText do begin<br>&nbsp; &nbsp; Right := Left + size.cx;<br>&nbsp; &nbsp; Bottom := Top + Size.cy;<br>&nbsp; end;<br><br><br><br>&nbsp; if (CommonData&lt;&gt;nil) {and false} and PtInRect(RectText, CommonData.MousePos) then begin<br>&nbsp; &nbsp; {Bug Find 2002-05-13}<br>&nbsp; &nbsp; try<br>&nbsp; &nbsp; &nbsp; &nbsp; StrCopy(CommonData.BufferA,PChar(WideCharToString(Str)));<br>&nbsp; &nbsp; &nbsp; &nbsp; CommonData^.Rect := RectText;<br>&nbsp; &nbsp; except<br>&nbsp; &nbsp; &nbsp; &nbsp; GanWarning;<br>&nbsp; &nbsp; &nbsp; &nbsp; StrCopy(CommonData.BufferA, 'ERROR in ExtTextOutW');<br>&nbsp; &nbsp; end;<br>&nbsp; &nbsp; SendMessage(CommonData^.CallBackHandle, idMsg, Integer(tfExtTextOutW), 0);<br>&nbsp; end;<br>{$ENDIF}<br>last:<br>&nbsp; result := ExtTextOutW(DC, X, Y, Options, Rect, Str, Count, Dx);<br>&nbsp; InstallThunkFunc(tfExtTextOutW);<br>// &nbsp;UnInstallGanFilter;<br><br>// &nbsp;LeaveCriticalSection(g_CriticalSection);<br>end;<br><br>{=================== &nbsp;DrawText &nbsp;==============================================}<br>function GanDrawTextA(hDC: HDC; lpString: PAnsiChar; nCount: Integer;<br>&nbsp; var lpRect: TRect; uFormat: UINT): Integer; stdcall;<br>var<br>&nbsp; RectSave : TRect;<br>&nbsp; posDcOrg : TPoint;<br>begin<br>// &nbsp;EnterCriticalSection(g_CriticalSection);<br><br>&nbsp; UnInstallThunkFunc(tfDrawTextA);<br>{$IFNDEF MSG_NOT_SEND}<br>&nbsp; if (CommonData&lt;&gt;nil) {and false} then begin<br>&nbsp; &nbsp; GetDcOrgEx(hDc, posDcOrg);<br>&nbsp; &nbsp; RectSave := lpRect;<br>&nbsp; &nbsp; OffsetRect(RectSave, posDcOrg.x, posDcOrg.y);<br><br>&nbsp; &nbsp; if PtInRect(RectSave, CommonData^.MousePos) then begin<br>&nbsp; &nbsp; &nbsp; try<br>&nbsp; &nbsp; &nbsp; &nbsp; StrCopy(CommonData.BufferA, lpString);<br>&nbsp; &nbsp; &nbsp; &nbsp; CommonData^.Rect := lpRect;<br>&nbsp; &nbsp; &nbsp; except<br>&nbsp; &nbsp; &nbsp; &nbsp; GanWarning;<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; SendMessage(CommonData^.CallBackHandle, idMsg, Integer(tfDrawTextA), 0);<br>&nbsp; &nbsp; end;<br>&nbsp; end;<br>{$ENDIF}<br>&nbsp; result := DrawTextA(hDC, lpString, nCount, lpRect, uFormat);<br>&nbsp; InstallThunkFunc(tfDrawTextA);<br><br>// &nbsp;UnInstallGanFilter;<br><br>// &nbsp;LeaveCriticalSection(g_CriticalSection);<br>end;<br><br>function GanDrawTextW(hDC: HDC; lpString: PWideChar; nCount: Integer;<br>&nbsp; var lpRect: TRect; uFormat: UINT): Integer; stdcall;<br>var<br>&nbsp; RectSave : TRect;<br>&nbsp; posDcOrg : TPoint;<br>begin<br>// &nbsp;EnterCriticalSection(g_CriticalSection);<br><br>&nbsp; UnInstallThunkFunc(tfDrawTextW);<br>{$IFNDEF MSG_NOT_SEND}<br>&nbsp; if (CommonData&lt;&gt;nil) {and false} then begin<br>&nbsp; &nbsp; GetDcOrgEx(hDc, posDcOrg);<br>&nbsp; &nbsp; RectSave := lpRect;<br>&nbsp; &nbsp; OffsetRect(RectSave, posDcOrg.x, posDcOrg.y);<br><br>&nbsp; &nbsp; if PtInRect(RectSave, CommonData^.MousePos) then begin<br>&nbsp; &nbsp; &nbsp; try<br>&nbsp; &nbsp; &nbsp; &nbsp; StrCopy(CommonData.BufferA,PChar(WideCharToString(lpString)));<br>&nbsp; &nbsp; &nbsp; &nbsp; CommonData^.Rect := lpRect;<br>&nbsp; &nbsp; &nbsp; except<br>&nbsp; &nbsp; &nbsp; &nbsp; GanWarning;<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; end;<br>&nbsp; &nbsp; SendMessage(CommonData^.CallBackHandle, idMsg, Integer(tfDrawTextW), 0);<br>&nbsp; end;<br>{$ENDIF}<br>&nbsp; result := DrawTextW(hDC, lpString, nCount, lpRect, uFormat);<br>&nbsp; InstallThunkFunc(tfDrawTextW);<br>// &nbsp;UnInstallGanFilter;<br><br>// &nbsp;LeaveCriticalSection(g_CriticalSection);<br>end;<br><br>procedure InstallGanFilter;<br>var<br>&nbsp; tfType : TThunkFunc;<br>begin<br>&nbsp; if bDllInstalled then exit;<br><br>&nbsp; for tfType := tfTextOutA to {tfExtTextOutW}tfDrawTextW do<br>&nbsp; // for tfType := LOW(TThunkFunc) to TThunkFunc(Ord(HIGH(TThunkFunc))-2) do<br>&nbsp; &nbsp; InstallThunkFunc(tfType);<br><br>&nbsp; bDllInstalled := true;<br>end;<br><br>procedure UnInstallGanFilter;<br>var<br>&nbsp; tfType : TThunkFunc;<br>begin<br>&nbsp; if not bDllInstalled then exit;<br><br>&nbsp; for tfType := tfTextOutA to {tfExtTextOutW}tfDrawTextW do<br>&nbsp; // for tfType := LOW(TThunkFunc) to TThunkFunc(Ord(HIGH(TThunkFunc))-2) do<br>&nbsp; &nbsp; UnInstallThunkFunc(tfType);<br><br>&nbsp; bDllInstalled := false;<br>end;<br><br>{================== &nbsp;=========================================================}<br>function WMCoverGetMinMaxInfo(<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hWnd &nbsp; &nbsp;: THandle;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Msg &nbsp; &nbsp; : LongWord;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wParam &nbsp;: WPARAM;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lParam &nbsp;: LPARAM):BOOL;stdcall;<br>var<br>&nbsp; info : ^MINMAXINFO;<br>begin<br>&nbsp; result := BOOL(0);<br>&nbsp; info := Pointer(lParam);<br>&nbsp; info^.ptMaxSize.x := GetSystemMetrics(SM_CXFULLSCREEN);<br>&nbsp; info^.ptMaxSize.y := GetSystemMetrics(SM_CYFULLSCREEN);<br>&nbsp; info^.ptMinTrackSize.x := 0;<br>&nbsp; info^.ptMinTrackSize.y := 0;<br>&nbsp; info^.ptMaxTrackSize.x := GetSystemMetrics(SM_CXFULLSCREEN);<br>&nbsp; info^.ptMaxTrackSize.y := GetSystemMetrics(SM_CYFULLSCREEN);<br>end;<br><br>function CoverMainProc(<br>&nbsp; &nbsp; hWnd:LongWord;<br>&nbsp; &nbsp; Message:LongWord;<br>&nbsp; &nbsp; wParam:WPARAM;<br>&nbsp; &nbsp; lParam:LPARAM<br>&nbsp; &nbsp; ):BOOL;stdcall;<br>begin<br>&nbsp; case Message of<br>&nbsp; &nbsp; WM_CLOSE :<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DestroyWindow(hWnd);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// PostQuitMessage(0);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; end;<br>&nbsp; result := BOOL(DefWindowProc(hWnd, Message, lParam, lParam));<br>end;<br><br><br>procedure GanGetWordTimer(wnd : HWND; msg, idTimer : Cardinal; dwTime : DWORD);far pascal;<br>begin<br>&nbsp; SendMessage(CommonData^.hWndMouse, idMsg, 1, 0);<br>&nbsp; if (CommonData.BufferA='') then begin<br>&nbsp; &nbsp; &nbsp; &nbsp; SendMessage(CommonData.CallBackHandle, idMsg, 0, 2);<br>&nbsp; end;<br>&nbsp; KillTimer(CommonData^.hWndFloat, 2);<br>end;<br><br>procedure WndCoverTimer(wnd : HWND; msg, idTimer : Cardinal; dwTime : DWORD);far pascal; //CallBack Type<br>var<br>&nbsp; mouseWnd : HWnd;<br>&nbsp; szClass : PChar;<br>&nbsp; strClass : string;<br>&nbsp; iLeft, iWidth : Integer;<br>&nbsp; rect : TRect;<br>begin<br>&nbsp; if (CommonData=nil) or (not CommonData^.bCapture) then begin<br>&nbsp; &nbsp; exit;<br>&nbsp; end;<br><br>&nbsp; mouseWnd := WindowFromPoint(CommonData^.MousePos);<br>&nbsp; if (mouseWnd=CommonData^.CallBackHandle) then begin<br>&nbsp; &nbsp; exit;<br>&nbsp; end;<br>&nbsp; szClass := StrAlloc(256);<br>&nbsp; GetClassName(mouseWnd, szClass, 255);<br>&nbsp; strClass := Strpas(szClass);<br>&nbsp; StrDispose(szClass);<br><br>&nbsp; CommonData^.bInSpec := FALSE;<br><br>&nbsp; if (Pos('Internet Explorer_Server', strClass)&gt;0) then begin<br>&nbsp; &nbsp; GetWindowRect(mouseWnd, rect);<br>&nbsp; &nbsp; iLeft := rect.Left - 4;<br>&nbsp; &nbsp; iWidth := rect.Right - rect.Left + 14;<br>&nbsp; &nbsp; if (CommonData^.MousePos.x - iLeft &gt; 200) then begin<br>&nbsp; &nbsp; &nbsp; iLeft := CommonData^.MousePos.x - 200;<br>&nbsp; &nbsp; &nbsp; iWidth := 210;<br>&nbsp; &nbsp; end;<br>&nbsp; &nbsp; CommonData^.bInSpec := TRUE;<br>&nbsp; end<br>&nbsp; else begin<br>&nbsp; &nbsp; iLeft := CommonData^.MousePos.x - 1;<br>&nbsp; &nbsp; iWidth := 1;<br>&nbsp; end;<br>&nbsp; // InstallGanFilter;<br>(*<br>&nbsp; SetWindowPos(CommonData^.hWndFloat,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;HWND_TOPMOST,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CommonData.MousePos.x, CommonData.MousePos.y, 10, 10,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SWP_NOACTIVATE or SWP_SHOWWINDOW);<br>&nbsp; ShowWindow(CommonData^.hWndFloat, SW_HIDE);<br>*)<br>&nbsp; CommonData^.BufferA := '';<br>&nbsp; SetWindowPos(CommonData^.hWndFloat,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;HWND_TOPMOST,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;iLeft{CommonData.MousePos.x-1}, CommonData.MousePos.y-1,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;iWidth, 2,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;88{SWP_NOACTIVATE or SWP_NOREDRAW});<br><br>&nbsp; SendMessage(CommonData^.hWndMouse, idMsg, 0, 0);<br><br><br> MoveWindow(CommonData^.hWndFloat, -1, -1, 1, 1, TRUE);<br><br>&nbsp; {<br>&nbsp; SetWindowPos(CommonData^.hWndFloat,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;HWND_TOPMOST,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CommonData.MousePos.x, CommonData.MousePos.y,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;120, 1,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SWP_NOACTIVATE or SWP_SHOWWINDOW);<br>&nbsp; ShowWindow(CommonData^.hWndFloat, SW_HIDE);<br>&nbsp; }<br>&nbsp; SetTimer(CommonData^.hWndFloat, 2, 300, @GanGetWordTimer);<br>end;<br><br>procedure InitCoverWindow(hInst : LongWord);<br>var<br>&nbsp; WndClass : TWndClass; //Ex;<br>begin<br>&nbsp; with WndClass do begin<br>&nbsp; &nbsp; style &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= WS_EX_TOPMOST;<br>&nbsp; &nbsp; lpfnWndProc &nbsp; &nbsp; &nbsp; &nbsp;:= @CoverMainProc; &nbsp;(*消息处理函数*)<br>&nbsp; &nbsp; hInstance &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= hInst;<br>&nbsp; &nbsp; hbrBackground &nbsp; &nbsp; &nbsp;:= color_btnface + 1;<br>&nbsp; &nbsp; lpszClassname &nbsp; &nbsp; &nbsp;:= 'GanFreeDict';<br>&nbsp; &nbsp; hicon &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= 0;<br>&nbsp; &nbsp; hCursor &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= 0;<br>&nbsp; &nbsp; cbClsExtra &nbsp; &nbsp; &nbsp; &nbsp; := 0;<br>&nbsp; &nbsp; cbWndExtra &nbsp; &nbsp; &nbsp; &nbsp; := 0;<br>&nbsp; end;<br><br>&nbsp; try<br>&nbsp; &nbsp; if not BOOL(RegisterClass{Ex}(WndClass)) then begin<br>&nbsp; &nbsp; &nbsp; MessageBox(0,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PChar(Format('$EEEE, Can not register class CHILD %d',[GetLastError])),<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'Register Error',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MB_OK);<br>&nbsp; &nbsp; end;<br>&nbsp; except<br>&nbsp; &nbsp; MessageBox(0, 'EXCEPTION', 'Register Class', MB_OK);<br>&nbsp; end;<br><br>&nbsp; hWndCover := CreateWindowEx(WS_EX_TOPMOST or WS_EX_TOOLWINDOW,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'GanFreeDict',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '^_^',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WS_POPUP or WS_VISIBLE,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -1,-1,1,1,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hInst, // GetModuleHandle('dll.dll'), // 98 for this, 2000 for 0<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nil);<br><br>&nbsp; if CommonData&lt;&gt;nil then begin<br>&nbsp; &nbsp; CommonData^.hWndFloat := hWndCover;<br>&nbsp; end;<br>&nbsp; SetTimer(hWndCover, 1, 450, @WndCoverTimer);<br><br>end;<br>(******************************************************************************)<br>function GanServerProc(<br>&nbsp; &nbsp; hWnd:LongWord;<br>&nbsp; &nbsp; Message:LongWord;<br>&nbsp; &nbsp; wParam:WPARAM;<br>&nbsp; &nbsp; lParam:LPARAM<br>&nbsp; &nbsp; ):BOOL;stdcall;<br>begin<br>&nbsp; if (Message=idMsg) then &nbsp;begin<br>&nbsp; &nbsp; if (wParam = 0) then begin<br>&nbsp; &nbsp; &nbsp; InstallGanFilter;<br>&nbsp; &nbsp; end<br>&nbsp; &nbsp; else begin<br>&nbsp; &nbsp; &nbsp; UnInstallGanFilter;<br>&nbsp; &nbsp; end;<br>&nbsp; end;<br>&nbsp; case Message of<br>&nbsp; &nbsp; WM_CLOSE :<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DestroyWindow(hWnd);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// PostQuitMessage(0);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; end;<br>&nbsp; result := BOOL(DefWindowProc(hWnd, Message, lParam, lParam));<br>end;<br><br><br>procedure InitServerWnd;<br>var<br>&nbsp; WndClass : TWndClass; //Ex;<br>begin<br>&nbsp;with WndClass do begin<br>&nbsp; &nbsp; style &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= WS_EX_TOPMOST;<br>&nbsp; &nbsp; lpfnWndProc &nbsp; &nbsp; &nbsp; &nbsp;:= @GanServerProc; &nbsp;(*消息处理函数*)<br>&nbsp; &nbsp; hInstance &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= GetModuleHandle('GFDict.dll');<br>&nbsp; &nbsp; hbrBackground &nbsp; &nbsp; &nbsp;:= color_btnface + 1;<br>&nbsp; &nbsp; lpszClassname &nbsp; &nbsp; &nbsp;:= 'GanServerDict';<br>&nbsp; &nbsp; hicon &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= 0;<br>&nbsp; &nbsp; hCursor &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= 0;<br>&nbsp; &nbsp; cbClsExtra &nbsp; &nbsp; &nbsp; &nbsp; := 0;<br>&nbsp; &nbsp; cbWndExtra &nbsp; &nbsp; &nbsp; &nbsp; := 0;<br>&nbsp; end;<br><br>&nbsp; try<br>&nbsp; &nbsp; if not BOOL(RegisterClass{Ex}(WndClass)) then begin<br>&nbsp; &nbsp; &nbsp; MessageBox(0,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PChar(Format('Can not register class server %d',[GetLastError])),<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'Register Error',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MB_OK);<br>&nbsp; &nbsp; end;<br>&nbsp; except<br>&nbsp; &nbsp; MessageBox(0, 'EXCEPTION', 'Register Server Class', MB_OK);<br>&nbsp; end;<br><br>&nbsp; hWndServer := CreateWindowEx(WS_EX_TOPMOST or WS_EX_TOOLWINDOW,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'GanServerDict',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'Gan Server',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WS_POPUP or WS_VISIBLE,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -1,-1,1,1,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0, //hInst, // GetModuleHandle('dll.dll'), // 98 for this, 2000 for 0<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nil);<br>&nbsp; if (hWndServer=0) then begin<br>&nbsp; &nbsp; MessageBeep(0);<br>&nbsp; end;<br><br>end;<br>(******************************************************************************)<br><br>procedure InitThunkCode;<br>var<br>&nbsp; tfType : TThunkFunc;<br>&nbsp; hMod : HMODULE;<br>&nbsp; pSysFunc, pThunkFunc : Pointer;<br>begin<br>&nbsp; for tfType := LOW(TThunkFunc) to HIGH(TThunkFunc) do begin<br>&nbsp; &nbsp; // clear to zero<br>&nbsp; &nbsp; FillChar(ThunkCodeArr[tfType], sizeof(TThunkCode), 0);<br><br>&nbsp; &nbsp; // fill it by right value<br>&nbsp; &nbsp; hMod := 0;<br>&nbsp; &nbsp; hMod := GetModuleHandle(PChar(ThunkFuncNameArr[tfType].strMod));<br>&nbsp; &nbsp; if hMod = 0 then continue;<br><br>&nbsp; &nbsp; pSysFunc := nil;<br>&nbsp; &nbsp; pSysFunc := GetProcAddress(hMod,<br>&nbsp; &nbsp; &nbsp; PChar(ThunkFuncNameArr[tfType].strSysProc));<br>&nbsp; &nbsp; if pSysFunc = nil then continue;<br><br>&nbsp; &nbsp; pThunkFunc := nil;<br>&nbsp; &nbsp; pThunkFunc := GetProcAddress(hInstance,<br>&nbsp; &nbsp; &nbsp; PChar(ThunkFuncNameArr[tfType].strThunkProc));<br>&nbsp; &nbsp; if pThunkFunc = nil then continue;<br><br>&nbsp; &nbsp; // now fill it!<br>&nbsp; &nbsp; ThunkCodeArr[tfType].addr_sys := pSysFunc;<br>&nbsp; &nbsp; ThunkCodeArr[tfType].addr_thunk := pThunkFunc;<br><br>&nbsp; &nbsp; ThunkCodeArr[tfType].codeThunk.siJmp := ShortInt($E9); &nbsp;// jmp ____<br>&nbsp; &nbsp; ThunkCodeArr[tfType].codeThunk.dwAddr :=<br>&nbsp; &nbsp; &nbsp; DWORD(pThunkFunc) - DWORD(pSysFunc) - 5;<br><br>&nbsp; &nbsp; ThunkCodeArr[tfType].codeBak.siJmp := PByte(pSysFunc)^;<br>&nbsp; &nbsp; ThunkCodeArr[tfType].codeBak.dwAddr := PDWORD(DWORD(pSysFunc)+1)^;<br>&nbsp; end;<br>end;<br><br>{================== &nbsp;Install Mouse Hook Support ==============================}<br>function MousePosHookHandler(iCode: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;<br>var<br>&nbsp; pMouse : PMOUSEHOOKSTRUCT;<br>&nbsp; mPoint : TPoint;<br>&nbsp; rect : TRect;<br>&nbsp; bMousePosChg : boolean;<br>begin<br>&nbsp; if iCode &lt; 0 then<br>&nbsp; begin<br>&nbsp; &nbsp; Result := CallNextHookEx(hNextHookProc, iCode, wParam, lParam);<br>&nbsp; end<br>&nbsp; else<br>&nbsp; if (CommonData&lt;&gt;nil) and<br>&nbsp; &nbsp; (CommonData^.bCapture) and<br>&nbsp; &nbsp; (TryEnterCriticalSection(m_CriticalSection))<br>&nbsp; then begin<br><br>{$IFDEF WIN_9X}<br>&nbsp; &nbsp; if bFirst then begin<br>&nbsp; &nbsp; &nbsp; bFirst := false;<br>&nbsp; &nbsp; &nbsp; // InstallGanFilter;<br>&nbsp; &nbsp; &nbsp; InitCoverWindow;<br>&nbsp; &nbsp; end;<br>{$ENDIF}<br><br>&nbsp; &nbsp; pMouse := PMOUSEHOOKSTRUCT(lParam);<br><br>&nbsp; &nbsp; if (CommonData&lt;&gt;nil) then begin<br>&nbsp; &nbsp; &nbsp; CommonData.MousePos := pMouse.pt;<br>&nbsp; &nbsp; &nbsp; CommonData.hWndCapture := pMouse.hWnd;<br>&nbsp; &nbsp; &nbsp; PostMessage(CommonData.CallBackHandle, idMsg, 0, 1);<br>&nbsp; &nbsp; end;<br>&nbsp; &nbsp; if (GetCurrentProcessID &lt;&gt; CommonData^.CallBackProcID) then begin<br>&nbsp; &nbsp; &nbsp; CommonData^.hWndMouse := hWndServer;<br><br>&nbsp; &nbsp; &nbsp; mPoint := pMouse^.pt;<br>&nbsp; &nbsp; &nbsp; ScreenToClient(pMouse^.hwnd, mPoint);<br>&nbsp; &nbsp; &nbsp; if Assigned(CommonData) then<br>&nbsp; &nbsp; &nbsp; &nbsp; CommonData.MousePClient := mPoint;<br>&nbsp; &nbsp; end<br>&nbsp; &nbsp; else begin<br>&nbsp; &nbsp; &nbsp; CommonData^.hWndMouse := 0;<br><br>&nbsp; &nbsp; end;<br>(*<br>&nbsp; &nbsp; if (pMouse.pt.x = LastMousePos.x) and (pMouse.pt.y = LastMousePos.y) then<br>&nbsp; &nbsp; &nbsp; bMousePosChg := false<br>&nbsp; &nbsp; else begin<br>&nbsp; &nbsp; &nbsp; bMousePosChg := true;<br>&nbsp; &nbsp; &nbsp; LastMousePos := pMouse.pt;<br>&nbsp; &nbsp; end;<br>&nbsp; &nbsp; if (wParam = WM_MOUSEMOVE)<br>&nbsp; &nbsp; &nbsp; and true<br>{$IFDEF WIN_9X}<br>&nbsp; &nbsp; &nbsp; and (hWndCover &lt;&gt; 0)<br>{$ENDIF}<br>&nbsp; &nbsp; &nbsp; and bMousePosChg<br>&nbsp; &nbsp; &nbsp; and (not b_InCS)<br>&nbsp; &nbsp; &nbsp; and (GetTickCount - LastTime &gt; G_DELAY_TIME) then<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; LastTime := GetTickCount;<br><br>&nbsp; &nbsp; &nbsp; // whether in my window<br>&nbsp; &nbsp; &nbsp; if (CommonData&lt;&gt;nil) and<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(GetCurrentProcessID = CommonData^.CallBackProcID) then begin<br>&nbsp; &nbsp; &nbsp; &nbsp; result := 0;<br>&nbsp; &nbsp; &nbsp; &nbsp; LeaveCriticalSection(m_CriticalSection);<br>&nbsp; &nbsp; &nbsp; &nbsp; result := CallNextHookEx(hNextHookProc, iCode, wParam, lParam);<br>&nbsp; &nbsp; &nbsp; &nbsp; exit;<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; mPoint := pMouse^.pt;<br>&nbsp; &nbsp; &nbsp; ScreenToClient(pMouse^.hwnd, mPoint);<br>&nbsp; &nbsp; &nbsp; if Assigned(CommonData) then<br>&nbsp; &nbsp; &nbsp; &nbsp; CommonData.MousePClient := mPoint;<br><br>&nbsp; &nbsp; &nbsp; rect.TopLeft := mPoint;<br>&nbsp; &nbsp; &nbsp; rect.Right := mPoint.x + 2;<br>&nbsp; &nbsp; &nbsp; rect.Bottom := mPoint.y + 1;<br>&nbsp; &nbsp; &nbsp; // Work for NT 2000 XP<br>{$IFDEF WIN_NT}<br>&nbsp; &nbsp; &nbsp; InstallGanFilter;<br><br>&nbsp; &nbsp; &nbsp; if Assigned(CommonData) then<br>&nbsp; &nbsp; &nbsp; &nbsp; CommonData.BufferA := '';<br><br>&nbsp; &nbsp; &nbsp; InvalidateRect(pMouse^.hWnd, @rect, TRUE);<br>&nbsp; &nbsp; &nbsp; if (mPoint.X&lt;0) or (mPoint.Y&lt;0) then<br>&nbsp; &nbsp; &nbsp; &nbsp; SendMessage(pMouse.hwnd, WM_NCPAINT, 1, 0)<br>&nbsp; &nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; &nbsp; SendMessage(pMouse.hwnd, WM_PAINT, 0, 0);<br><br>&nbsp; &nbsp; &nbsp; UninstallGanFilter;<br>&nbsp; &nbsp; &nbsp; if Assigned(CommonData) and (CommonData.BufferA='') then begin<br>&nbsp; &nbsp; &nbsp; &nbsp; SendMessage(CommonData.CallBackHandle, idMsg, 0, 2);<br>&nbsp; &nbsp; &nbsp; end;<br>{$ENDIF}<br>&nbsp; &nbsp; &nbsp; // flowing work on 98<br>{$IFDEF WIN_9X}<br>&nbsp; &nbsp; &nbsp; if (hWndCover &lt;&gt; 0) then begin<br>&nbsp; &nbsp; &nbsp; &nbsp; SetWindowPos(hWndCover, 0, pMouse.pt.X, pMouse.pt.Y, 4, 1,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SWP_NOZORDER or SWP_NOACTIVATE);<br>&nbsp; &nbsp; &nbsp; &nbsp; ShowWindow(hWndCover, SW_SHOW);<br><br>// &nbsp; &nbsp; &nbsp; &nbsp;EnterCriticalSection(m_CriticalSection);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; InstallGanFilter;<br>&nbsp; &nbsp; &nbsp; &nbsp; ShowWindow(hWndCover, SW_HIDE);<br><br>// &nbsp; &nbsp; &nbsp; &nbsp;LeaveCriticalSection(m_CriticalSection);<br>&nbsp; &nbsp; &nbsp; end;<br>{$ENDIF}<br>&nbsp; &nbsp; end;<br>*)<br>&nbsp; &nbsp; LeaveCriticalSection(m_CriticalSection);<br>&nbsp; &nbsp; Result := CallNextHookEx(hNextHookProc, iCode, wParam, lParam);<br>&nbsp; end<br>&nbsp; else begin<br>&nbsp; &nbsp; Result := CallNextHookEx(hNextHookProc, iCode, wParam, lParam);<br>&nbsp; end;<br>end;<br><br>function EnableMouseHook(hld:hwnd; ProcessID : DWORD; hInst:THandle): BOOL; export;<br>begin<br>&nbsp; Result := False;<br>&nbsp; if hNextHookProc &lt;&gt; 0 then Exit;<br><br>&nbsp; hNextHookProc := SetWindowsHookEx(WH_MOUSE, MousePosHookHandler,Hinstance, 0);<br>// &nbsp; &nbsp;GetWindowThreadProcessID(hWnd, nil));<br><br>&nbsp; InitCoverWindow(hInst);<br>&nbsp; if CommonData &lt;&gt; nil then begin<br>&nbsp; &nbsp; CommonData^.CallBackHandle := hld;<br>&nbsp; &nbsp; CommonData^.CallBackProcID := ProcessID;<br>&nbsp; end;<br>&nbsp; Result :=hNextHookProc &lt;&gt; 0 ;<br>end;<br><br>function DisableMouseHook: BOOL; export;<br>begin<br>try<br>&nbsp; if hNextHookProc &lt;&gt; 0 then<br>&nbsp; begin<br>&nbsp; &nbsp; KillTimer(CommonData^.hWndFloat, 1);<br>&nbsp; &nbsp; KillTimer(CommonData^.hWndFloat, 2);<br>&nbsp; &nbsp; SendMessage(CommonData^.hWndFloat, WM_CLOSE, 0, 0);<br>&nbsp; &nbsp; CommonData^.hWndFloat := 0;<br><br>&nbsp; &nbsp; UnInstallGanFilter;<br>&nbsp; &nbsp; UnhookWindowshookEx(hNextHookProc);<br>&nbsp; &nbsp; hNextHookProc := 0;<br>&nbsp; end;<br>&nbsp; Result := hNextHookProc = 0;<br>except<br>&nbsp; MessageBeep(0);<br>end;<br>end;<br><br>function SetCaptureFlag(bSet:BOOL):BOOL; export;<br>begin<br>&nbsp; if CommonData&lt;&gt;nil then begin<br>&nbsp; &nbsp; result := TRUE;<br>&nbsp; &nbsp; CommonData^.bCapture := bSet;<br>&nbsp; end<br>&nbsp; else begin<br>&nbsp; &nbsp; result := FALSE;<br>&nbsp; end;<br>end;<br><br>procedure DllMain(dwReason : DWORD);<br>begin<br>&nbsp; case dwReason of<br>&nbsp; &nbsp; DLL_PROCESS_ATTACH :<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; // InstallGanFilter;<br>&nbsp; &nbsp; &nbsp; &nbsp; // InitCoverWindow;<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; DLL_PROCESS_DETACH :<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; if (hWndServer &lt;&gt; 0) then begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SendMessage(hWndServer, WM_CLOSE, 0, 0);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hWndServer := 0;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UnRegisterClass('GanServerDict', hInstance);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; except<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBeep(0);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; &nbsp; UnInstallGanFilter;<br>&nbsp; &nbsp; &nbsp; &nbsp; if CommonData&lt;&gt;nil then begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UnMapViewOfFile(CommonData);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CommonData := nil;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CloseHandle(HMapFile);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HMapFile := 0;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; except<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox(0,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'Error when free MapViewFile',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'FreeDict Error',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MB_OK);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br>(*<br>&nbsp; &nbsp; &nbsp; &nbsp; if (hWndCover &lt;&gt; 0) then begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DestroyWindow(hWndCover);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hWndCover := 0;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (UnRegisterClass('GanFreeDict', hInstance)) then<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {MessageBox(0,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'Success to Unregister _GanFreeDict_ Class',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'Success',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MB_OK);}<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; except<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox(0,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'Error when Destroy window and UnRegisterClass',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'FreeDict Error',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MB_OK);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br>*)<br><br>&nbsp; &nbsp; &nbsp; &nbsp; if hProc&lt;&gt;0 then begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CloseHandle(hProc);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hProc := 0;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; except<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox(0,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'Error when CloseHandle',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'FreeDict Error',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MB_OK);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; DeleteCriticalSection(g_CriticalSection);<br>&nbsp; &nbsp; &nbsp; &nbsp; DeleteCriticalSection(m_CriticalSection);<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; DLL_THREAD_ATTACH :<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; DLL_THREAD_DETACH :<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; end;<br>end;<br><br>exports<br>&nbsp; EnableMouseHook,<br>&nbsp; DisableMouseHook,<br>&nbsp; GanTextOutA,<br>&nbsp; GanTextOutW,<br>&nbsp; GanExtTextOutA,<br>&nbsp; GanExtTextOutW,<br>&nbsp; GanDrawTextA,<br>&nbsp; GanDrawTextW,<br>&nbsp; SetCaptureFlag;<br><br>begin<br>&nbsp; InitializeCriticalSection(g_CriticalSection);<br>&nbsp; InitializeCriticalSection(m_CriticalSection);<br>&nbsp; b_InCS := false;<br>&nbsp; hNextHookProc := 0;<br>&nbsp; hProc := 0;<br>&nbsp; bFirst := true;<br>&nbsp; bDllInstalled := false;<br>&nbsp; hWndCover := 0;<br>&nbsp; hWndServer := 0;<br>&nbsp; CommonData := nil;<br>&nbsp; HMapFile := 0;<br>&nbsp; LastTime := 0;<br>&nbsp; FillChar(LastMousePos, sizeof(TPoint), 0);<br>&nbsp; idMsg := RegisterWindowMessage(STR_MSGNOTIFY);<br><br>&nbsp; MapCommonData;<br><br>&nbsp; hProc := OpenProcess(PROCESS_ALL_ACCESS,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FALSE,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;GetCurrentProcessID());<br>&nbsp; InitThunkCode;<br>&nbsp; InitServerWnd;<br>&nbsp; // InitCoverWindow;<br><br>&nbsp; // DisableThreadLibraryCalls(hInstance);<br><br>&nbsp; DLLProc := @DLLMain;<br>&nbsp; DLLMain(DLL_PROCESS_ATTACH);<br>end.<br><br>&nbsp;<br>&nbsp;<br>来自:huiyugan, 时间:2002-5-25 13:42:00, ID:1123372 <br>工程FreeDict.dpr<br>主程序<br>program FreeDict;<br><br>uses<br>&nbsp; Forms,<br>&nbsp; untMain in 'untMain.pas' {frmGanDict},<br>&nbsp; untAbout in 'untAbout.pas' {AboutBox},<br>&nbsp; untTypes in 'untTypes.pas';<br><br>{$R *.RES}<br><br>begin<br>&nbsp; Application.Initialize;<br>&nbsp; Application.CreateForm(TfrmGanDict, frmGanDict);<br>&nbsp; Application.CreateForm(TAboutBox, AboutBox);<br>&nbsp; Application.Run;<br>end.<br>&nbsp;<br>&nbsp;<br>来自:cozo, 时间:2002-5-25 13:44:00, ID:1123375 <br>好人哪!学习中,没看懂。<br>&nbsp;<br>&nbsp;<br>来自:huiyugan, 时间:2002-5-25 13:44:00, ID:1123376 <br>单元untMain.pas的代码,窗体设置见下<br>(*******************************************************************************<br>* Copy Right (C) Gan Huaxin 2001, 2002, huiyugan@263.net<br>* A Free Screen Words Capture Library<br>* &nbsp; Dedicated to my GirlFriend Sunny, Happy for ever<br>*<br>* Version &nbsp; &nbsp; &nbsp; &nbsp; Date &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Modification<br>* &nbsp; 0.1 &nbsp; &nbsp; &nbsp; 2001-11-07~09 &nbsp; &nbsp; &nbsp; New, oly a test<br>* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Can Get Word, Sometimes occure error<br>* &nbsp; 0.2 &nbsp; &nbsp; &nbsp; 2002-05-14~16 &nbsp; &nbsp; &nbsp; Some Bugs Fixed,And<br>*******************************************************************************)<br>unit untMain;<br><br>interface<br><br>uses<br>&nbsp; Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,<br>&nbsp; StdCtrls, untTypes;<br><br>type<br>&nbsp; TfrmGanDict = class(TForm)<br>&nbsp; &nbsp; btnLoad: TButton;<br>&nbsp; &nbsp; btnUnLoad: TButton;<br>&nbsp; &nbsp; lblHwnd: TLabel;<br>&nbsp; &nbsp; btnAbout: TButton;<br>&nbsp; &nbsp; lblMousePos: TLabel;<br>&nbsp; &nbsp; memoThunk: TMemo;<br>&nbsp; &nbsp; lblFontWidth: TLabel;<br>&nbsp; &nbsp; lblRect: TLabel;<br>&nbsp; &nbsp; procedure btnLoadClick(Sender: TObject);<br>&nbsp; &nbsp; procedure btnUnLoadClick(Sender: TObject);<br>&nbsp; &nbsp; procedure FormDestroy(Sender: TObject);<br>&nbsp; &nbsp; procedure FormCreate(Sender: TObject);<br>&nbsp; &nbsp; procedure btnAboutClick(Sender: TObject);<br>&nbsp; private<br>&nbsp; &nbsp; { Private declarations }<br>&nbsp; public<br>&nbsp; &nbsp; { Public declarations }<br>&nbsp; &nbsp; procedure WndProc(var Mess: TMessage); override;<br>&nbsp; end;<br><br>var<br>&nbsp; frmGanDict: TfrmGanDict;<br><br>implementation<br><br>uses untAbout;<br><br>{$R *.DFM}<br><br>var<br>&nbsp; HMapFile:THandle;<br>&nbsp; CommonData:^TCommonData;<br><br><br>const<br>&nbsp; STR_MSGNOTIFY:pchar='WM_GANNOTIFY';<br>var<br>&nbsp; idMsg : UINT;<br><br>function EnableMouseHook(hld:hwnd; ProcessID : DWORD; hInst : THandle): BOOL; external 'GFDict.dll';<br>function DisableMouseHook: BOOL; external 'GFDict.dll';<br>function SetCaptureFlag(bFlag:BOOL): BOOL; external 'GFDict.dll';<br><br>procedure MapCommonData;<br>var FirstCall: Boolean;<br>begin<br>&nbsp; HMapFile:=OpenFileMapping(FILE_MAP_WRITE, False, 'GanGan_ThunkDict');<br>&nbsp; FirstCall:=(HMapFile = 0);<br>&nbsp; if FirstCall then<br>&nbsp; &nbsp; HMapFile:=CreateFileMapping($FFFFFFFF,nil,PAGE_READWRITE,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0,SizeOf(TCommonData),<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'GanGan_ThunkDict');<br>&nbsp; CommonData:= MapViewOfFile(HMapFile, FILE_MAP_WRITE, 0, 0, 0);<br>&nbsp; if FirstCall then FillChar(CommonData^, SizeOf(TCommonData), 0);<br>end;<br><br>procedure TfrmGanDict.btnLoadClick(Sender: TObject);<br>begin<br>&nbsp; if not EnableMouseHook(handle, GetCurrentProcessID, Application.Handle) then<br>&nbsp; &nbsp; ShowMessage('ERROR')<br>&nbsp; else<br>&nbsp; &nbsp; SetCaptureFlag(TRUE);<br>end;<br><br>procedure TfrmGanDict.btnUnLoadClick(Sender: TObject);<br>begin<br>&nbsp; DisableMouseHook;<br>end;<br><br>procedure TfrmGanDict.FormDestroy(Sender: TObject);<br>begin<br>&nbsp; DisableMouseHook;<br>&nbsp; if CommonData&lt;&gt;nil then begin<br>&nbsp; &nbsp; UnMapViewOfFile(CommonData);<br>&nbsp; &nbsp; CommonData := nil;<br>&nbsp; &nbsp; CloseHandle(HMapFile);<br>&nbsp; &nbsp; HMapFile := 0;<br>&nbsp; end;<br>end;<br><br>procedure TfrmGanDict.FormCreate(Sender: TObject);<br>begin<br>&nbsp; idMsg := RegisterWindowMessage(STR_MSGNOTIFY);<br>&nbsp; CommonData := nil;<br>&nbsp; MapCommonData;<br>&nbsp; SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SWP_NOSIZE or SWP_NOMOVE);<br>end;<br><br>const<br>&nbsp; StrProcNames : array[0..5] of String =<br>&nbsp; &nbsp; ('TextOutA',<br>&nbsp; &nbsp; &nbsp;'TextOutW',<br>&nbsp; &nbsp; &nbsp;'ExtTextOutA',<br>&nbsp; &nbsp; &nbsp;'ExtTextOutW',<br>&nbsp; &nbsp; &nbsp;'DrawTextA',<br>&nbsp; &nbsp; &nbsp;'DrawTextW');<br>procedure TfrmGanDict.WndProc(var Mess: TMessage);<br>begin<br>&nbsp; case Mess.LParam of<br>&nbsp; &nbsp; 0:<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; if (mess.msg = idMsg) then begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (Mess.wParam &gt;=0) and (Mess.WParam &lt;= 5) then begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lblHwnd.Caption := StrProcNames[mess.wParam]; //Format('Handle : 0x%X', [mess.wParam]);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if CommonData &lt;&gt; nil then with CommonData^ do begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; memoThunk.Text := CommonData.BufferA;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lblRect.Caption := Format('Client X:%d, Y:%d, Rect[%d,%d,%d,%d]',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [MousePClient.x, MousePClient.y,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Rect.Left, Rect.Top, Rect.Right, Rect.Bottom]);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // lblThunkText.Caption := CommonData.BufferA;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end else<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lblHwnd.Caption := 'UnKnow Message';<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; 1:<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; if CommonData&lt;&gt;nil then with CommonData^ do<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lblMousePos.Caption := Format('Mouse Pos X : %d, Y : %d',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [MousePos.X,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MousePos.Y]);<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; 2:<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; memoThunk.Text := '---';<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; 3:<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; lblFontWidth.Caption := Format('Font Width : %d', [mess.wParam]);<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; end;<br>&nbsp; inherited;<br>end;<br><br>procedure TfrmGanDict.btnAboutClick(Sender: TObject);<br>begin<br>&nbsp; AboutBox.ShowModal;<br>end;<br><br>end.<br><br>(××××××××××××下面试窗体设置×××××××××××)<br>object frmGanDict: TfrmGanDict<br>&nbsp; Left = 564<br>&nbsp; Top = 163<br>&nbsp; Width = 280<br>&nbsp; Height = 237<br>&nbsp; Caption = 'Gan'#39's Free Dict'<br>&nbsp; Color = clBtnFace<br>&nbsp; Font.Charset = DEFAULT_CHARSET<br>&nbsp; Font.Color = clWindowText<br>&nbsp; Font.Height = -11<br>&nbsp; Font.Name = 'MS Sans Serif'<br>&nbsp; Font.Style = []<br>&nbsp; OldCreateOrder = False<br>&nbsp; OnCreate = FormCreate<br>&nbsp; OnDestroy = FormDestroy<br>&nbsp; PixelsPerInch = 96<br>&nbsp; TextHeight = 13<br>&nbsp; object lblHwnd: TLabel<br>&nbsp; &nbsp; Left = 8<br>&nbsp; &nbsp; Top = 8<br>&nbsp; &nbsp; Width = 76<br>&nbsp; &nbsp; Height = 13<br>&nbsp; &nbsp; Caption = 'Window Handle'<br>&nbsp; end<br>&nbsp; object lblMousePos: TLabel<br>&nbsp; &nbsp; Left = 8<br>&nbsp; &nbsp; Top = 152<br>&nbsp; &nbsp; Width = 56<br>&nbsp; &nbsp; Height = 13<br>&nbsp; &nbsp; Caption = 'Mouse Pos:'<br>&nbsp; end<br>&nbsp; object lblFontWidth: TLabel<br>&nbsp; &nbsp; Left = 8<br>&nbsp; &nbsp; Top = 192<br>&nbsp; &nbsp; Width = 52<br>&nbsp; &nbsp; Height = 13<br>&nbsp; &nbsp; Caption = 'Font Width'<br>&nbsp; end<br>&nbsp; object lblRect: TLabel<br>&nbsp; &nbsp; Left = 8<br>&nbsp; &nbsp; Top = 176<br>&nbsp; &nbsp; Width = 23<br>&nbsp; &nbsp; Height = 13<br>&nbsp; &nbsp; Caption = 'Rect'<br>&nbsp; end<br>&nbsp; object btnLoad: TButton<br>&nbsp; &nbsp; Left = 104<br>&nbsp; &nbsp; Top = 112<br>&nbsp; &nbsp; Width = 75<br>&nbsp; &nbsp; Height = 25<br>&nbsp; &nbsp; Caption = 'Load'<br>&nbsp; &nbsp; TabOrder = 0<br>&nbsp; &nbsp; OnClick = btnLoadClick<br>&nbsp; end<br>&nbsp; object btnUnLoad: TButton<br>&nbsp; &nbsp; Left = 192<br>&nbsp; &nbsp; Top = 112<br>&nbsp; &nbsp; Width = 75<br>&nbsp; &nbsp; Height = 25<br>&nbsp; &nbsp; Caption = 'UnLoad'<br>&nbsp; &nbsp; TabOrder = 1<br>&nbsp; &nbsp; OnClick = btnUnLoadClick<br>&nbsp; end<br>&nbsp; object btnAbout: TButton<br>&nbsp; &nbsp; Left = 192<br>&nbsp; &nbsp; Top = 144<br>&nbsp; &nbsp; Width = 75<br>&nbsp; &nbsp; Height = 25<br>&nbsp; &nbsp; Caption = 'About'<br>&nbsp; &nbsp; TabOrder = 2<br>&nbsp; &nbsp; OnClick = btnAboutClick<br>&nbsp; end<br>&nbsp; object memoThunk: TMemo<br>&nbsp; &nbsp; Left = 8<br>&nbsp; &nbsp; Top = 24<br>&nbsp; &nbsp; Width = 257<br>&nbsp; &nbsp; Height = 81<br>&nbsp; &nbsp; TabOrder = 3<br>&nbsp; end<br>end<br>&nbsp;<br>&nbsp;<br>来自:huiyugan, 时间:2002-5-25 13:45:00, ID:1123379 <br>单元untAbout<br>unit untAbout;<br><br>interface<br><br>uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,<br>&nbsp; Buttons, ExtCtrls;<br><br>type<br>&nbsp; TAboutBox = class(TForm)<br>&nbsp; &nbsp; Panel1: TPanel;<br>&nbsp; &nbsp; ProgramIcon: TImage;<br>&nbsp; &nbsp; ProductName: TLabel;<br>&nbsp; &nbsp; Version: TLabel;<br>&nbsp; &nbsp; Copyright: TLabel;<br>&nbsp; &nbsp; Comments: TLabel;<br>&nbsp; &nbsp; OKButton: TButton;<br>&nbsp; private<br>&nbsp; &nbsp; { Private declarations }<br>&nbsp; public<br>&nbsp; &nbsp; { Public declarations }<br>&nbsp; end;<br><br>var<br>&nbsp; AboutBox: TAboutBox;<br><br>implementation<br><br>{$R *.DFM}<br><br>end.<br>&nbsp;<br>其窗体<br>object AboutBox: TAboutBox<br>&nbsp; Left = 408<br>&nbsp; Top = 366<br>&nbsp; BorderStyle = bsSingle<br>&nbsp; Caption = 'About'<br>&nbsp; ClientHeight = 213<br>&nbsp; ClientWidth = 298<br>&nbsp; Color = clBtnFace<br>&nbsp; Font.Charset = DEFAULT_CHARSET<br>&nbsp; Font.Color = clWindowText<br>&nbsp; Font.Height = -11<br>&nbsp; Font.Name = 'MS Sans Serif'<br>&nbsp; Font.Style = []<br>&nbsp; OldCreateOrder = True<br>&nbsp; Position = poScreenCenter<br>&nbsp; PixelsPerInch = 96<br>&nbsp; TextHeight = 13<br>&nbsp; object Panel1: TPanel<br>&nbsp; &nbsp; Left = 8<br>&nbsp; &nbsp; Top = 8<br>&nbsp; &nbsp; Width = 281<br>&nbsp; &nbsp; Height = 161<br>&nbsp; &nbsp; BevelInner = bvRaised<br>&nbsp; &nbsp; BevelOuter = bvLowered<br>&nbsp; &nbsp; ParentColor = True<br>&nbsp; &nbsp; TabOrder = 0<br>&nbsp; &nbsp; object ProgramIcon: TImage<br>&nbsp; &nbsp; &nbsp; Left = 8<br>&nbsp; &nbsp; &nbsp; Top = 8<br>&nbsp; &nbsp; &nbsp; Width = 65<br>&nbsp; &nbsp; &nbsp; Height = 57<br>&nbsp; &nbsp; &nbsp; Picture.Data = {<br>&nbsp; &nbsp; &nbsp; &nbsp; 07544269746D617076020000424D760200000000000076000000280000002000<br>&nbsp; &nbsp; &nbsp; &nbsp; 0000200000000100040000000000000200000000000000000000100000000000<br>&nbsp; &nbsp; &nbsp; &nbsp; 000000000000000080000080000000808000800000008000800080800000C0C0<br>&nbsp; &nbsp; &nbsp; &nbsp; C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF<br>&nbsp; &nbsp; &nbsp; &nbsp; FF00000000000000000000000000000000000EE8787878EEEEEEE03F30878EEE<br>&nbsp; &nbsp; &nbsp; &nbsp; EEE00EE8787878EEEEEEE03F30878EEEEEE00EE8787878EEEEEEE03F30878EEE<br>&nbsp; &nbsp; &nbsp; &nbsp; EEE00EE8787878EEEEEEE03F30878EEEEEE00887787877788888803F3088787E<br>&nbsp; &nbsp; &nbsp; &nbsp; EEE00788787878878887803F3088887EEEE00788887888878887803F3088887E<br>&nbsp; &nbsp; &nbsp; &nbsp; EEE00877888887788888703F308887EEEEE00888777778888888037883088888<br>&nbsp; &nbsp; &nbsp; &nbsp; 8EE007777777777777703787883087777EE00888888888888803787FF8830888<br>&nbsp; &nbsp; &nbsp; &nbsp; 888008888888888880378777778830888880077777777788037873F3F3F87808<br>&nbsp; &nbsp; &nbsp; &nbsp; 88E00888888888803787FFFFFFFF8830EEE00887777778800001111111111100<br>&nbsp; &nbsp; &nbsp; &nbsp; EEE00888888888888899B999B99999EEEEE00888888888888899B9B99BB9B9EE<br>&nbsp; &nbsp; &nbsp; &nbsp; EEE0088888888888899BB9BB99BB99EEEEE0078888888888899B999B999999EE<br>&nbsp; &nbsp; &nbsp; &nbsp; EEE0087788888778899B9B9BB9BB99EEEEE00888778778888E9B9B9BB9999EEE<br>&nbsp; &nbsp; &nbsp; &nbsp; EEE0088888788888EE9B99B9BB9BEEEEEEE00EE8888888EEEEE999B9999EEEEE<br>&nbsp; &nbsp; &nbsp; &nbsp; EEE00EEEE888EEEEEEEE99BB999EEEEEEEE00EEEEE8EEEEEEEEEE999B9EEEEEE<br>&nbsp; &nbsp; &nbsp; &nbsp; EEE00EEEEE8EEEEEEEEEEEE999EEEEEEEEE00EEEEE8EEEEEEEEEEEEE99EEEEEE<br>&nbsp; &nbsp; &nbsp; &nbsp; EEE00EEEEE8EEEEEEEEEEEEE9EEEEEEEEEE00EEEEE8EEEEEEEEEEEEEEEEEEEEE<br>&nbsp; &nbsp; &nbsp; &nbsp; EEE00EEEEEEEEEEEEEEEEEEEEEEEEEEEEEE00000000000000000000000000000<br>&nbsp; &nbsp; &nbsp; &nbsp; 0000}<br>&nbsp; &nbsp; &nbsp; Stretch = True<br>&nbsp; &nbsp; &nbsp; IsControl = True<br>&nbsp; &nbsp; end<br>&nbsp; &nbsp; object ProductName: TLabel<br>&nbsp; &nbsp; &nbsp; Left = 88<br>&nbsp; &nbsp; &nbsp; Top = 16<br>&nbsp; &nbsp; &nbsp; Width = 155<br>&nbsp; &nbsp; &nbsp; Height = 13<br>&nbsp; &nbsp; &nbsp; Caption = 'Product Name: Gan'#39's Get Words'<br>&nbsp; &nbsp; &nbsp; IsControl = True<br>&nbsp; &nbsp; end<br>&nbsp; &nbsp; object Version: TLabel<br>&nbsp; &nbsp; &nbsp; Left = 88<br>&nbsp; &nbsp; &nbsp; Top = 40<br>&nbsp; &nbsp; &nbsp; Width = 107<br>&nbsp; &nbsp; &nbsp; Height = 13<br>&nbsp; &nbsp; &nbsp; Caption = 'Version : 0.01 (c) 2002'<br>&nbsp; &nbsp; &nbsp; IsControl = True<br>&nbsp; &nbsp; end<br>&nbsp; &nbsp; object Copyright: TLabel<br>&nbsp; &nbsp; &nbsp; Left = 8<br>&nbsp; &nbsp; &nbsp; Top = 80<br>&nbsp; &nbsp; &nbsp; Width = 152<br>&nbsp; &nbsp; &nbsp; Height = 13<br>&nbsp; &nbsp; &nbsp; Caption = 'Copyright (C) Gan Huaxin , 2002'<br>&nbsp; &nbsp; &nbsp; IsControl = True<br>&nbsp; &nbsp; end<br>&nbsp; &nbsp; object Comments: TLabel<br>&nbsp; &nbsp; &nbsp; Left = 8<br>&nbsp; &nbsp; &nbsp; Top = 104<br>&nbsp; &nbsp; &nbsp; Width = 265<br>&nbsp; &nbsp; &nbsp; Height = 39<br>&nbsp; &nbsp; &nbsp; Caption = 'Comments : Only a TEST'<br>&nbsp; &nbsp; &nbsp; WordWrap = True<br>&nbsp; &nbsp; &nbsp; IsControl = True<br>&nbsp; &nbsp; end<br>&nbsp; end<br>&nbsp; object OKButton: TButton<br>&nbsp; &nbsp; Left = 111<br>&nbsp; &nbsp; Top = 180<br>&nbsp; &nbsp; Width = 75<br>&nbsp; &nbsp; Height = 25<br>&nbsp; &nbsp; Caption = 'OK'<br>&nbsp; &nbsp; Default = True<br>&nbsp; &nbsp; ModalResult = 1<br>&nbsp; &nbsp; TabOrder = 1<br>&nbsp; end<br>end<br>&nbsp;<br>&nbsp;<br>来自:huiyugan, 时间:2002-5-25 13:49:00, ID:1123387 <br>GanFreeDictGrp.bpg.工程组文件<br><br><br>#------------------------------------------------------------------------------<br>VERSION = BWS.01<br>#------------------------------------------------------------------------------<br>!ifndef ROOT<br>ROOT = $(MAKEDIR)/..<br>!endif<br>#------------------------------------------------------------------------------<br>MAKE = $(ROOT)/bin/make.exe -$(MAKEFLAGS) -f$**<br>DCC = $(ROOT)/bin/dcc32.exe $**<br>BRCC = $(ROOT)/bin/brcc32.exe $**<br>#------------------------------------------------------------------------------<br>PROJECTS = GFDict.dll FreeDict.exe<br>#------------------------------------------------------------------------------<br>default: $(PROJECTS)<br>#------------------------------------------------------------------------------<br><br>GFDict.dll: GFDict.dpr<br>&nbsp; $(DCC)<br><br>FreeDict.exe: FreeDict.dpr<br>&nbsp; $(DCC)<br><br>&nbsp;<br>&nbsp;<br>
 
to ZhuMoo:<br>&nbsp; &nbsp; 对不起,我觉得您这样贴是否太多了,<br>&nbsp; &nbsp; 其实您完全可以给他一个链接。<br>&nbsp; &nbsp; 况且,其实这份代码我已经email给他了。<br>&nbsp; &nbsp; 如果您觉得可以,您再编辑一下你的发言,也许对很多人阅读起来会方面一点。<br>&nbsp; &nbsp; 当然了,我很欢迎您散播很多东西。
 
http://www.delphibbs.com/delphibbs/dispq.asp?lid=1123349
 
屏幕取词的完整解决方案见我的《delphi深入windows核心编程》一书,<br>解决了IE、win98下的高技术难题,支持windows98/2000/xp,<br>我的主页http://wenjinshan.yeah.net
 
后退
顶部