在vb中用shell运行完一个ms_dos程序后,弹出一个黑黑的dos窗口,如何将其去掉!

发表于:2007-06-21来源:作者:点击数: 标签:
影子 答: 取得窗口标题,用 PostMessage 关闭窗口,PostMessage 用法看下面的文章。 ipzone 答: Public Declare Function OpenProcess Lib "kernel32" Alias "OpenProcess" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProces

   
影子 答:
取得窗口标题,用 PostMessage 关闭窗口,PostMessage 用法看下面的文章。

ipzone 答:

Public Declare Function OpenProcess Lib "kernel32" Alias "OpenProcess" (ByVal dwDesiredAclearcase/" target="_blank" >ccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long

Public Declare Function CloseHandle Lib "kernel32" Alias "CloseHandle" (ByVal hObject As Long) As Long

exam:
p_handle=shell("abc.exe",1)
h_program=OpenProcess(0,flase,p_hamdle)

`h_program=0,正在运行
`h_program<>0,运行完毕
Public Declare Function OpenProcess Lib "kernel32" Alias "OpenProcess" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long

Public Declare Function CloseHandle Lib "kernel32" Alias "CloseHandle" (ByVal hObject As Long) As Long

exam:
p_handle=shell("abc.exe",1)
h_program=OpenProcess(0,flase,p_hamdle)

`h_program=0,正在运行
`h_program<>0,运行完毕

原文转自:http://www.ltesting.net