VB能关闭其它应用程序吗?

来源:百度知道 编辑:UC知道 时间:2024/06/17 22:28:54
我的程序中调用了UUCALL电话软件,由于使用了Setparent 函数,所以在关闭程序时自动关闭了UUCALLL软件,但在有些机器上出现UUCALL程序错误提示,不知是什么原因,有没有什么函数能正常合法的关闭其它带托盘图标的应用程序?给个代码,我使用了Sendmessage函数,但只能关闭UUCALE主界面,无法关闭托盘程序
AlphaBlend 的回答是可行的,但是托盘图标不会自动消失,还请继续帮忙!

'VB 终止指定进程 ,刷新托盘图标

Private Type PROCESSENTRY32
dwSize As Long
cntUsage As Long
th32ProcessID As Long
th32DefaultHeapID As Long
th32ModuleID As Long
cntThreads As Long
th32ParentProcessID As Long
pcPriClassBase As Long
dwFlags As Long
szExeFile As String * 1024
End Type

Private Type MODULEENTRY32
dwSize As Long
th32ModuleID As Long
th32ProcessID As Long
GlblcntUsage As Long
ProccntUsage As Long
modBaseAddr As Byte
modBaseSize As Long
hModule As Long
szModule As String * 256
szExePath As String * 1024
End Type

Private Const WM_MOUSEMOVE = &H200

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As