已知窗口句柄,如何知道该程序加载了哪些DLL?
请前辈们指点,谢谢!
请前辈们指点,谢谢!
解决方案 »
- Hint 何解
- 新手上路 高手帮忙下 新手1756
- DELPHI+ORACLE 关于同时写2个用户的表!!!!急!!
- activskin 在使用时换肤后 Image控件不能显示图像的问题,请教高手,高分相求
- 讨论:为什么管家婆软件这么快!而我用ado+access速度这么慢?
- 关于DBGrid的行号,出了Recno没有其它方法了吗???????????????
- 如何调用外部动态库中的过程和函数?
- Delphi6.0程序如何制作安装盘
- 再问个问题,vb中的createobject方法,在delphi6中该怎么用!
- about InterBase
- 求fastreport delphi2010版
- Delphi在代码编辑栏按回车无法换行
详细请参考windows程序设计
vc tool 中的depends工具试试
{function GetDllHostAppPath(DllPath:string; var ProcIDArr:TArrCardinal; var ArrPath:TArrPChar;var iNum:integer):boolean;
var
ContinueLoop,
MContinueLoop: BOOL;
FSnapshotHandle,
MFSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
ModuleEntry32 : TModuleEntry32;
bGet:boolean;
iProcCount:integer;
sDllPath,sProcPath:string;
begin
try
SetLength(ProcIDArr,0);
SetLength(ArrPath,0);
iNum:=0;
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := Sizeof(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle,FProcessEntry32);
while integer(ContinueLoop) <> 0 do
begin
bGet:=False;
MFSnapshotHandle:=CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,FProcessEntry32.th32ProcessID);
ModuleEntry32.dwSize:=sizeof(TModuleEntry32);
MContinueLoop:=Module32First(MFSnapshotHandle,ModuleEntry32);
while integer(MContinueLoop) <> 0 do
begin
sDllPath:=GetDllPath(ModuleEntry32.hModule);
bGet:=UpperCase(sDllPath)=UpperCase(DllPath);
if bGet then Break;
MContinueLoop:=Module32Next(MFSnapshotHandle,ModuleEntry32);
end;
if bGet then
begin
sProcPath:=GetProcessPath(FProcessEntry32.th32ProcessID);
if sProcPath<>'' then
begin
iProcCount:=Length(ProcIDArr);
SetLength(ProcIDArr,iProcCount+1);
SetLength(ArrPath,iProcCount+1); ProcIDArr[iProcCount]:=FProcessEntry32.th32ProcessID;
Move(PChar(sProcPath)^,ArrPath[iProcCount],Length(sProcPath));
Inc(iNum);
end;
end; ContinueLoop := Process32Next(FSnapshotHandle,FProcessEntry32);
end;
result:=True;
except
result:=False;
end;
end;