为什么 我的DLL注入到 EXplorer成功后 没有执行相关的代码呢 还有 就是机器重新启动之后 怎么就没有呢呢
解决方案 »
- indy ftp的测试程序,问题出在哪里?
- 请教 用LoadFromFile从二进制文件加载数据到ADOTabl
- 关于类型定义错误提示
- 如何创建一个像资源管理器一样的东西
- 十万火急!!!!!ACITVE控件问题!!!!就30分了全部送上!
- Delphi7.0中的函数问题?
- 怎样才能够将日期型、数字型的数值添加到字段里
- 用delphi把excel表插入sql server数据库怎样做?
- 关于query或adoquery1的locate属性在网络中的用法!
- Berlin 10.1 up1来了
- 高分请教高手:关于MDI中主窗体和子窗体的工具栏自动转换问题!!!
- fastreport如何打印NED字样
############################
library implementd;{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }uses
SysUtils,
Classes,
Dialogs,
myhook in 'myhook.pas',
define in 'define.pas';{$R *.RES}
exports
SetHook,Unhook;begin
if SetHook() then showmessage('Install hook ok');
end.
#################################################################
unit myhook;interface
uses windows,Dialogs,SysUtils;
var
OldHook,NewHook:HHOOK; //用来保存HOOK的返回值
OldProc:FARPROC; //用来指向窗口消息 字串8
Function SetHook:Boolean;stdcall;
function Unhook:boolean;stdcall;
Function HookProc(nCode,wParam,lParam:Integer):Integer;stdcall export;
Function WinProc(Hwnd,Msg,wParam,lParam:longint):LRESULT; stdcall;
implementation
{###################################################################################}
//安装HOOK
Function SetHook:Boolean;stdcall;
begin
//安装HOOK
showmessage('begin install');
OldHook:=SetWindowsHookEx(WH_GETMESSAGE,@HookProc,Hinstance,0);
//NewHook:=SetWindowsHookEx(WH_KEYBOARD,@HookProc,Hinstance,0);
Result := False;
if (OldHook=0) then exit else Result:=True;
end;function Unhook:boolean;stdcall;
Begin
if UnhookWindowsHookEx(OldHook) then
showmessage('测试卸载')
else
showmessage('测试卸载失败');
End;
{###################################################################################}
//HOOK回调函数
Function HookProc(nCode,wParam,lParam:Integer):integer;stdcall export;
var
WinStr:HWND;
begin
//设置热键
showmessage('测试安装');
if (wParam=VK_F2) then
begin
showmessage('测试安装' + inttostr(VK_F2));
end
else if(wParam=VK_F3) then
Unhook();
//将HOOK传递给Windows处理
Result:=CallNextHookEx(OldHook,nCode,wParam,lParam);
end;{###################################################################################}
//自定义Windows消息处理函数
Function WinProc(Hwnd,Msg,wParam,lParam:longint):LRESULT; stdcall;
begin
{在这做出对消息的处理 字串3
case Msg of
WM_ACTIVATEAPP:exit;
WM_ACTIVATE:exit;
WM_KILLFOCUS:exit;
WM_SETFOCUS:exit;
end;
上面这些消息是窗口失去焦点和获得焦点的屏蔽
}
//将窗口消息传递给Windows处理
Result:=CallWindowProc(OldProc,Hwnd,Msg,wParam,lParam);
end;
end.
补充一点: 不要搞盗密码的东西.BS搞这样的东西的人.技术研究可.