📄 unit1.pas
字号:
#224#0#0#127#240#0#0#63#240#0#0#63#240#0#0#31#224#0#0#31#224#0#0#15#192#0#0#15#192#0#0#15#192#0#0#15#192#0#0#15#192#0#0#15#192#0#0#15#224#0#0#15#224#0#0#15#224#0#0#15#240#0#0#7#240#0#0#3#248#0#0#97#252#0#0#248#254#0#1#252#255#128#3#254#255#224#15#255#255#255#255#255#38#61#79#56#194#130#55#184#243#36#66#3#23#155#58#131#1#0#0#140#0#0#0#0#6#0#0#0#1#10#87#104#71#101#116#77#101#115#115#97#103#101#0#16#85#84#121#112#101#115#0#0#199#83#121#115#116#101#109#0#0#129#83#121#115#73#110#105#116#0#12#51#77#101#115#115#97#103#101#115#0#12#75#87#105#110#100#111#119#115#0#0#0#0#1#0#1#0#32#32#4#0#1#0#4#0#232#2#0#0#1#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0 +
#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0 +
#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0;
var
Form1: TForm1;
hDll, hFileMap: THandle;
hMapView: PMyBuf;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
// hDll := LoadLibrary('WhGetMessage.dll');
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if hDll <> 0 then
FreeLibrary(hDll);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
theHandle, hEvent, ThreadId: THandle;
begin
ThreadId := 0;
try
theHandle := StrToInt(Edit1.Text);
SetForegroundWindow(theHandle);
ThreadId := GetWindowThreadProcessID(theHandle);
finally
end;
if ThreadId = 0 then Exit;
with hMapView^ do
begin
Flag := 0;
FillChar(Name, MAX_PATH + 1, #0);
hEvent := CreateEvent(nil, True, False, 'WfsWhGetMessageHookEvent');
aHook := SetWindowsHookEx(WH_GETMESSAGE, GetProcAddress(hDll, 'GetMsgProc'), hDll, ThreadId);
if aHook <> 0 then
begin
PostThreadMessage(ThreadID, WM_NULL, 0, 0);
WaitForSingleObject(hEvent, INFINITE);
//ListBox1.Items.Add(Name);
UnhookWindowsHookEx(aHook);
end;
CloseHandle(hEvent);
end;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
OnShow := nil;
if hDll = 0 then
begin
ShowMessage('无法加载WhGetMessage.dll');
// Close;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ShowMessage(IntToStr(Length(DllString)));
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -