7,763
社区成员
发帖
与我相关
我的任务
分享
Private Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As Any, lpThreadAttributes As Any, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal lpCurrentDriectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long
Private Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessId As Long
dwThreadId As Long
End Type
Private Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Private Const SW_SHOWNORMAL = 1
Private Const STARTF_USESHOWWINDOW = &H1
Private Sub Command1_Click()
Dim stProcessInfo As PROCESS_INFORMATION
Dim stStartInfo As STARTUPINFO
stStartInfo.cb = Len(stStartInfo)
stStartInfo.wShowWindow = SW_SHOWNORMAL
stStartInfo.dwFlags = STARTF_USESHOWWINDOW
CreateProcess vbNullString, "C:\QQ.exe", ByVal 0, ByVal 0, False, 0, ByVal 0, vbNullString, stStartInfo, stProcessInfo
End Sub
Private Sub Command1_Click()
Shell "C:\QQ.exe"
End Sub