救命!Delphi DLL中如何取得模块的Handle(20分)

  • 主题发起人 主题发起人 啥都懂点
  • 开始时间 开始时间

啥都懂点

Unregistered / Unconfirmed
GUEST, unregistred user!
我要调用GetModuleFileName,需要一个HMODULE,在Delphi如何取得这个值
 
当前程序就写0
 
我要的是DLL的文件路径啊,如果GetModuleFileName传0过去的话,将取得Host Application的
路径
 
用DLL的hInstance;
DLL 中
procedure YYY;
begin
MessageBox(GetActiveWindow, PChar(GetModuleName(hInstance)), 'YYY', MB_OK);
end;
 
使用FindHInstance取Handle
 
多谢了[:)]
 
后退
顶部