读书人

小疑点,高手帮下

发布时间: 2012-02-19 19:43:39 作者: rapoo

小问题,高手帮下
shell 一个程序,并且获得它的HWND.

[解决办法]
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
Const SW_SHOWNORMAL = 1

Private Sub Form_Load()
Dim hwdApp As Long

hwdApp = ShellExecute(0, vbNullString, "Notepad.exe ", vbNullString, "C:\ ", SW_SHOWNORMAL)
MsgBox hwdApp
End Sub

读书人网 >VB

热点推荐