vb.net中怎么用ShellExecute?急~~

来源:百度知道 编辑:UC知道 时间:2024/06/11 11:59:28
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

dim path as string="d:\1.txt"
ShellExecute(Me.Handle.ToInt32, "Open", path, "", "", 1)
总是报错,
是不是在Me.Handle.ToInt32这个地方出错,在vb中这个地方的参数是hwnd
,vb.net中如何处理?
高手帮解答下,谢~

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Int32, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Int32) As Long
---------
声明问题
long改成Int32