?? unit1.pas
字號:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
Button1: TButton;
Edit1: TEdit;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
const
WM_TestMessage = WM_USER + 2000;
var
Form2: TForm2;
myhwnd:hwnd;
function HookOn(lpHwnd:HWND):bool;stdcall;external 'OLHookdll.dll' name 'sethook';
function hookoff(lpHwnd:HWND):Bool;stdcall;external 'OLHookdll.dll' name 'endhook';
implementation
{$R *.dfm}
procedure TForm2.FormCreate(Sender: TObject);
begin
myhwnd:=findwindow(nil,'口袋西游');
if myhwnd<>0 then
begin
if HookOn(myhwnd) then
EDIT1.Text:='$'+inttohex(myhwnd,8);
end;
end;
procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if myhwnd<>0 then
hookoff(myhwnd);
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
if myhwnd<>0 then
begin
sendmessage(myhwnd,WM_TestMessage,0,0);
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -