cls923580()你好,我声明的是以下这两个API函数:
Declare Function GetDesktopWindow Lib "user32" Alias "GetDesktopWindow" () As Long
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As Object, ByVal ByVallpParameters As String, ByVal _lpDirectory As String, ByVal nShowCmd As Long) As Long
代码是这样写的:
Private Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
api的的声明,如
Private Declare Function BitBlt Lib "gdi32.dll" Alias "BitBlt" (ByVal hdcDest As IntPtr, ByVal nXDest As Integer, ByVal nYDest As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal _
hdcSrc As IntPtr, ByVal nXSrc As Integer, ByVal nYSrc As Integer, ByVal dwRop As System.Int32) As Long '声明BitBlt
其实vb.net中api的声明与vb差不多,只是需要修改类型,如将long要改为integer
可以在platform中查找到相应函数,做些适当修改即可