Dim xian As Long, chen1 As SECURITY_ATTRIBUTES, chen2 As SECURITY_ATTRIBUTES chen1.nLength = Len(chen1) chen2.nLength = Len(chen2) Dim chen3 As STARTUPINFO, chen4 As PROCESS_INFORMATIONCreateProcess vbNullString, "c:\text.exe", chen1, chen2, True, HIGH_PRIORITY_CLASS, 0&, vbNullString, chen3, chen4 hprocess=chen4.hProcess
Public Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As SECURITY_ATTRIBUTES, lpThreadAttributes As SECURITY_ATTRIBUTES, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal lpCurrentDriectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long 我写以上这些不能用呀
我会用CreateProcess了,但用TerminateProcess不能,谁能教我??
Private Sub 计算器menu_Click() 这个最好用 On Error GoTo err1 Dim tr tr = Shell("c:\windows\calc.exe", vbNormalFocus) Exit Sub err1: tr = Shell("c:\winnt\System32\calc.exe", vbNormalFocus) End Sub
?:为什么用printform语句不能打印窗体上的图像?如何解决?请指教。
楼上的那位,用paintpicture stium(人侠)看看以下的代码: (自己声明几个涵数:createprocess,TerminateProcess,几个类型.) private hProcess as long const HIGH_PRIORITY_CLASS=&H80 Dim xian As Long, chen1 As SECURITY_ATTRIBUTES, chen2 As SECURITY_ATTRIBUTES chen1.nLength = Len(chen1) chen2.nLength = Len(chen2) Dim chen3 As STARTUPINFO, chen4 As PROCESS_INFORMATIONCreateProcess vbNullString, "c:\text.exe", chen1, chen2, True, '运行c:\text.exe HIGH_PRIORITY_CLASS, 0&, vbNullString, chen3, chen4 hprocess=chen4.hProcess '获得进程 然后 TerminateProcess hprocess,0 or TerminateProcess hprocess,0& 将其关闭
chen1.nLength = Len(chen1)
chen2.nLength = Len(chen2)
Dim chen3 As STARTUPINFO, chen4 As PROCESS_INFORMATIONCreateProcess vbNullString, "c:\text.exe", chen1, chen2, True, HIGH_PRIORITY_CLASS, 0&, vbNullString, chen3, chen4
hprocess=chen4.hProcess
是什么?请告手指点
我写以上这些不能用呀
这个最好用
On Error GoTo err1
Dim tr
tr = Shell("c:\windows\calc.exe", vbNormalFocus)
Exit Sub
err1: tr = Shell("c:\winnt\System32\calc.exe", vbNormalFocus)
End Sub
stium(人侠)看看以下的代码:
(自己声明几个涵数:createprocess,TerminateProcess,几个类型.)
private hProcess as long
const HIGH_PRIORITY_CLASS=&H80
Dim xian As Long, chen1 As SECURITY_ATTRIBUTES, chen2 As SECURITY_ATTRIBUTES
chen1.nLength = Len(chen1)
chen2.nLength = Len(chen2)
Dim chen3 As STARTUPINFO, chen4 As PROCESS_INFORMATIONCreateProcess vbNullString, "c:\text.exe", chen1, chen2, True, '运行c:\text.exe HIGH_PRIORITY_CLASS, 0&, vbNullString, chen3, chen4
hprocess=chen4.hProcess '获得进程
然后 TerminateProcess hprocess,0 or TerminateProcess hprocess,0&
将其关闭