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中如何处理?
高手帮解答下,谢~
vb.net中怎么用ShellExecute?急~~
答案:2 悬赏:30
解决时间 2021-03-22 14:21
- 提问者网友:柠檬香
- 2021-03-21 22:47
最佳答案
- 二级知识专家网友:duile
- 2021-03-21 22:58
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
---------
声明问题
long改成Int32
全部回答
- 1楼网友:為→妳鎖鈊
- 2021-03-21 23:18
添加一个 module1
public 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
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯