✔ 最佳答案
先Imports System.Runtime.InteropServices
然後系Class開頭寫:
<DllImport(FileName:String)> Function FunctionName(Args As Type) As Value
Example:很常用的Findwindow API
Imports System.Runtime.InteropServices
Public Class Form1
<DllImport(“user32”)> _
Public Shared Function Findwindow(ByVal lpClassName As String, ByVal lpWindowName As String) As Integer 'Integer可改作IntPtr
End Function
End Class
以後調用很方便,按照上例,可寫
Findwindow(vbNullString,Me.Text)
注意,請改正文中之全形字或引號。
2008-01-04 17:02:29 補充:
你的dll不是自己寫的嗎?如果dll支持.NET環境,可引用之,然後按F2查看可用之函數、方法及屬性。如果實在是沒辦法,可以下載Depency Walker分析dll裏的函數:
http://www.dependencywalker.com/depends22_x86.zip
2008-01-04 17:08:49 補充:
更正:Depency Walker Dependency Walker