Private Sub Command1_Click() Shell "c:\windows\winmine.exe", vbNormalFocus End SubPrivate Sub Command2_Click() Shell "C:\Program Files\Microsoft Office\Office\winword.exe", vbNormalFocusEnd SubPrivate Sub Command3_Click() Shell "C:\Program Files\Internet Explorer\iexplore.exe", vbNormalFocus End Sub
1、用shell()语句,但功能比较单一
2、用API函数ShellExecute,但用起来稍麻烦一些!
shellexecute
重复了
假设你的应用程序的路径是c:\word.exe,那么
shell("c:\word.exe")
具体的看MSDN了,很好用的哟!
你可以得到你SHELL的应用程序的PID,控制起来就很方便了
Shell "c:\windows\winmine.exe", vbNormalFocus
End SubPrivate Sub Command2_Click()
Shell "C:\Program Files\Microsoft Office\Office\winword.exe", vbNormalFocusEnd SubPrivate Sub Command3_Click()
Shell "C:\Program Files\Internet Explorer\iexplore.exe", vbNormalFocus
End Sub