程序的功能是非异步执行程序,就是后台的程序要等到前台的执行完毕后,才继续以下是API调用:===========================Option ExplicitPrivate Declare Function WaitForSingleObject Lib "kernel32" (ByVal hProcess As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function CreateProcessA Lib "kernel32" (ByVal lpApplicationName As Long, ByVal lpCommandLine As String, ByVal lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As Long, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As LongPrivate Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessId As Long
dwThreadId As Long
End TypePrivate Type STARTUPINFO
cb As Long
lpReserved As Long
lpDesktop As Long
lpTitle As Long
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 TypePrivate 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===========================
以下是主程序
Private Sub new_Click() Dim start As STARTUPINFO, proc As PROCESS_INFORMATION
CreateProcessA 0&, App.Path & "\update.exe", 0&, 0&, 1&, _
0, 0&, 0&, start, proc
WaitForSingleObject proc.hProcess, -1end sub
===========================
现在的问题是,我想让前台的程序运行是HIDE,所以必须调节一下API里的相关参数;上次有朋友告诉我,是调节STARTUPINFO数据结构里的 wShowWindow 参数现在我的问题是这个参数的赋值应该在哪里写,怎么写?谢谢!!
Private Declare Function CreateProcessA Lib "kernel32" (ByVal lpApplicationName As Long, ByVal lpCommandLine As String, ByVal lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As Long, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As LongPrivate Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessId As Long
dwThreadId As Long
End TypePrivate Type STARTUPINFO
cb As Long
lpReserved As Long
lpDesktop As Long
lpTitle As Long
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 TypePrivate 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===========================
以下是主程序
Private Sub new_Click() Dim start As STARTUPINFO, proc As PROCESS_INFORMATION
CreateProcessA 0&, App.Path & "\update.exe", 0&, 0&, 1&, _
0, 0&, 0&, start, proc
WaitForSingleObject proc.hProcess, -1end sub
===========================
现在的问题是,我想让前台的程序运行是HIDE,所以必须调节一下API里的相关参数;上次有朋友告诉我,是调节STARTUPINFO数据结构里的 wShowWindow 参数现在我的问题是这个参数的赋值应该在哪里写,怎么写?谢谢!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货