?? win.dpr
字號:
library Win;
uses
SysUtils,
windows,
Forms,
Messages,
ShareDat in 'ShareDat.pas',
ToolPop in 'ToolPop.pas' {Frm_Pop},
MyThreads in 'MyThreads.pas';
var Frm_Pop: TFrm_Pop;
{$R *.res}
Function GameHookProc(iCode: integer; wParam: wParam; lParam:lParam):LResult; stdcall;
var AppRect:TRect;
begin
if (iCode=HC_ACTION) and ((lParam and $80000000) = 0) and (DllData^.GameHwnd<>0) then
begin
Case wParam of
VK_INSERT:begin
if Frm_Pop<>nil then begin
Frm_Pop.ChangeValue;
CtrlDefLife;
end;
end;
VK_DELETE:begin
if Frm_Pop<>nil then begin
Frm_Pop.ChangeValue;
CtrlAutoSay;
end;
end;
VK_HOME:begin
if Frm_Pop<>nil then begin
Frm_Pop.ChangeValue;
CtrlMouse;
end;
end;
VK_NUMLOCK:begin
if ToolShow=False then begin
try
GetWindowRect(DllData^.GameHwnd,AppRect);
Application.Handle:=DllData^.GameHwnd;
Frm_Pop:=TFrm_Pop.Create(Application);
Frm_Pop.Left:=AppRect.Left;
Frm_Pop.Top:=AppRect.top+40
finally
Frm_Pop.Show;
ToolShow:=True;
end;
end else begin
Frm_Pop.Hide;
ToolShow:=False;
end;
end;
end;
end;
Result:=CallNextHookEx(DLLData^.KeyHook, iCode, wParam, lParam);
end;
Function MouseHookProc(iCode: integer; wParam: wParam; lParam:lParam):LResult; stdcall;
procedure SimulateKey(bVk:BYTE);
begin
if (GetKeyState(bVk)>0) then
keybd_event(bVk, MapVirtualKey(bVk, 0), KEYEVENTF_KEYUP, 0)
else
keybd_event(bVk, MapVirtualKey(bVk, 0), 0, 0);
end;
begin
if iCode>= 0 then if (wParam = WM_RBUTTONDOWN ) then SimulateKey(byMouseKey);
Result:=CallNextHookEx(DLLData^.MouseHook, iCode, wParam, lParam);
end;
function SetHook:Boolean;stdcall;
var TId:DWORD;
begin
Result:=False;
if (DllData^.GameHwnd<>0) and (DLLData^.KeyHook=0) and (DLLData^.MouseHook=0) then
begin
Tid:=GetWindowThreadProcessId(DllData^.GameHwnd,nil) ;
DLLData^.KeyHook:=SetWindowsHookEx(WH_KEYBOARD, GameHookProc, GetModuleHandle('RxStar.dll'), Tid);
DLLData^.MouseHook:=SetWindowsHookEx(WH_MOUSE, MouseHookProc, GetModuleHandle('RxStar.dll'), Tid);
end;
if (DLLData^.KeyHook<>0) and (DLLData^.MouseHook<>0) then Result:=True;
end;
procedure UnHook;stdcall;
begin
if DLLData^.KeyHook<>0 then UnhookWindowsHookEx(DLLData^.KeyHook);
if DLLData^.MouseHook<>0 then UnhookWindowsHookEx(DLLData^.MouseHook);
end;
procedure MyDLLHandler(Reason: Integer);
var FHandle: LongWORD;
begin
case Reason of
DLL_PROCESS_ATTACH: begin
FHandle:=CreateFileMapping($FFFFFFFF, nil, PAGE_READWRITE, 0, $ffff, 'FISHWINGAME');
if FHandle=0 then
if GetLastError=ERROR_ALREADY_EXISTS then begin
FHandle:=OpenFileMapping(FILE_MAP_ALL_ACCESS, False, 'FISHWINGAME');
if FHandle=0 then Exit;
end else Exit;
DLLData:=MapViewOfFile(FHandle, FILE_MAP_ALL_ACCESS, 0, 0, 0);
if DLLData=nil then CloseHandle(FHandle);
end;
DLL_PROCESS_DETACH:
begin
if Assigned(DLLData) then begin
UnmapViewOfFile(DLLData);
DLLData:=nil;
end;
end;
end;
end;
exports
SetHook,UnHook;
begin
DLLProc:=@MyDLLHandler;
MyDLLhandler(DLL_PROCESS_ATTACH);
DLLData^.KeyHooked:=False;
DLLData^.KeyHook:=0;
DLLData^.MouseHooked:=False;
DLLData^.MouseHook:=0;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -