哪位大侠能帮我解释一下这些vb语句!

来源:百度知道 编辑:UC知道 时间:2024/05/31 09:57:37
Private Declare Function WinExec Lib "kernel32" (ByVal lpCmdLine As String, ByVal nCmdShow As Long) As Long
Private Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long

Private Sub Command1_Click()
Dim cmd As String
Dim hWnd As Integer
cmd = App.Path & "\ARJ.pif " & " a " & Text2.Text & " " & Text1.Text 'text1,text2输入文件路径
hWnd = WinExec(cmd, 0) '参数为0则隐藏窗体
If hWnd < 32 Then 'hWin<32则启动应用程序失败
MsgBox "error!"
Exit Sub
End If
While GetModuleHandle(hWnd%)
MousePointer = 11 '鼠标呈沙漏状
WAIT% = DoEvents()
Wend
MousePointer = 1 '鼠标复原为箭头
MsgBox "finished"
End Sub

Private Sub Command2_Click()
Dim cmd A

声明 WINDOWS API 函数
Private Declare Function WinExec Lib "kernel32" (ByVal lpCmdLine As String, ByVal nCmdShow As Long) As Long
是 运行指定的程序
Private Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
是 获取一个应用程序或动态链接库的模块句柄

While GetModuleHandle(hWnd%)
WAIT% = DoEvents()
wend
'这是一个循环,就是获取应用程序或动态链接库的模块句柄 直到成功 才退出循环,WAIT% = DoEvents() 是不让这个循环造成死机,将控制权交给系统

你是不是陈勇辉啊?