导出DLL中的函数?(200分)

  • 主题发起人 主题发起人 fineboy
  • 开始时间 开始时间
F

fineboy

Unregistered / Unconfirmed
GUEST, unregistred user!
&nbsp;我在进行Shell Extension ,有一个函数ShFindComputer(param1,param2),也知道它在Shell32.dll中,<br>可是怎样得到它的参数列表,或者是它的Index,MSHelp中没有提供帮助.Delphi5中也没有.<br>函数的功能是打开查找计算机对话框.<br>敬请高手赐教!
 
看看 MSDN 中有没有,要是没有就算了
 
哪里有windows 原代码下载?
 
我的天!问这个问题岂不是跟问盖茨的银行账号一样?
 
哈哈哈<br>不过,听说老盖要给出源代码,另外它的账号曾经被盗过
 
source/vcl/win/windows.pas可是你想要的?
 
我K,不搜索?回答过了,不过只能在Win9x中调用,你用动态调用的方法吧!<br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=494310<br>
 
我看到这家伙要windows 原代码下载就把我吓傻了,没敢继续回答问题。
 
没有什么很好的办法(我所知的;)<br>如果实在是找不到资料,<br>可以试着这样做,<br>用softice、trw或source,dasm去看它的参数调用情况,一般都可以分析出来<br><br>当然,如果能搞到windows的源代码,<br>那就最好不过了。<br>
 
哈!我好象帮你找到了<br>unit FindDialogs;<br><br>{**********************************************************}<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ &nbsp;TFindFilesDialog &amp; TFindComputerDialog Unit &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ &nbsp;Copyright ?999 Workshell Software. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ &nbsp; }<br>{ &nbsp;Version 1.0 &nbsp; }<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ &nbsp;Web &nbsp; &nbsp; &nbsp;-&gt; http://www.workshell.uni.cc/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ &nbsp;E - Mail -&gt; finddlgs@kinsella.u-net.com &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{**********************************************************}<br><br>interface<br><br>uses<br>&nbsp; Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,<br>&nbsp; ShlObj;<br><br>type<br>&nbsp; TFindFilesDialog = class(TComponent)<br>&nbsp; private<br>&nbsp; &nbsp; { Private declarations }<br>&nbsp; protected<br>&nbsp; &nbsp; { Protected declarations }<br>&nbsp; public<br>&nbsp; &nbsp; { Public declarations }<br>&nbsp; &nbsp; function Execute: Boolean;<br>&nbsp; &nbsp; function ExecuteEx(pidlRoot, pidlSavedSearch: PItemIDList): Boolean;<br>&nbsp; published<br>&nbsp; &nbsp; { Published declarations }<br>&nbsp; end;<br><br>type<br>&nbsp; TFindComputerDialog = class(TComponent)<br>&nbsp; private<br>&nbsp; &nbsp; { Private declarations }<br>&nbsp; protected<br>&nbsp; &nbsp; { Protected declarations }<br>&nbsp; public<br>&nbsp; &nbsp; { Public declarations }<br>&nbsp; &nbsp; function Execute: Boolean;<br>&nbsp; &nbsp; function ExecuteEx(pidlRoot, pidlSavedSearch: PItemIDList): Boolean;<br>&nbsp; published<br>&nbsp; &nbsp; { Published declarations }<br>&nbsp; end;<br><br>procedure Register;<br><br>implementation<br><br>function SHFindFiles(pidlRoot: PItemIDList; pidlSavedSearch: PItemIDList): Boolean;<br>&nbsp;stdcall; external 'Shell32.dll' index 90;<br><br>function SHFindComputer(pidlRoot: PItemIDList; pidlSavedSearch: PItemIDList): Boolean;<br>&nbsp;stdcall; external 'Shell32.dll' index 91;<br><br>function TFindFilesDialog.Execute: Boolean;<br>begin<br>Result := SHFindFiles(nil,nil);<br>end;<br><br>function TFindFilesDialog.ExecuteEx(pidlRoot, pidlSavedSearch: PItemIDList): Boolean;<br>begin<br>Result := SHFindFiles(pidlRoot,pidlSavedSearch);<br>end;<br><br>function TFindComputerDialog.Execute: Boolean;<br>begin<br>Result := SHFindComputer(nil,nil);<br>end;<br><br>function TFindComputerDialog.ExecuteEx(pidlRoot, pidlSavedSearch: PItemIDList): Boolean;<br>begin<br>Result := SHFindComputer(pidlRoot,pidlSavedSearch);<br>end;<br><br>procedure Register;<br>begin<br>&nbsp; RegisterComponents('Dialogs', [TFindFilesDialog,TFindComputerDialog]);<br>end;<br><br>end.<br>
 
厉害!厉害!!
 
我十分感谢大家的关注,这个问题我想没有办法解决的!至少在中国!<br>因为MicroSoft的源代码开放政策不会对中国软件企业实施,我已经着手自己改写简单的<br>对话框了。<br>这个问题的答案没有对错!<br>我看我们只有看外国人的源代码来悟了!<br>我目前为止还没有办法搞清楚 DLL中的函数的参数列表,希望大家留意!<br>下次再来时,结束这个问题。
 
bbkxjy 说的还不够明白吗?<br>function SHFindComputer(pidlRoot: PItemIDList; pidlSavedSearch: PItemIDList): Boolean;<br>&nbsp;stdcall; external 'Shell32.dll' index 91;<br>
 
我觉得导出任意一个动态连接库中的函数的参数列表是不可能的,因此结束问题<br>to bbkkxjy ;<br>&nbsp; 你提供的代码不行,用index的想法本身就不对,因为windows的版本不同,不兼容<br>以后,在调用动态连接库中的函数时最好用name,而不是index,既兼容,速度也快!
 
:fineboy:<br>&nbsp; Index的速度恐怕要快一些吧?还有,这个API是没有公开的,没有Name表登记,只有用Index来<br>调用,的确不兼容,在2000里面就不能调用了.:)
 
to bbkxjy;<br>&nbsp; 你的方法不行,用index的方法我不推荐,建议你用 name调用动态连接库中的函数,<br>因为windows 的各个版本不同,动态连接库中的函数的index也会变的。而name 不变。<br>如你的代码,在windows me 中没有一点响应。但也不会出错<br>index 改了,也没事,只要不改变太多。<br>&nbsp; 建议以后,不要用索引,速度慢。还会出现不兼容问题!
 
那就用 shell Object 的 FindComputer 和 FindFiles 方法算了,就是少了一些参数。
 
多人接受答案了。
 
后退
顶部