可以試試下面程式碼~
雖然這是 VB6 的程式碼,但我有試過 VB2010 可以執行~
Private Declare Function EndTask Lib "user32" (ByVal hWnd As Long, ByVal fShutDown As Boolean, ByVal fForce As Boolean) As Long Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVallpClassName As String, ByVal lpWindowName As String) As Long
Call EndTask(FindWindow(vbNullString, "關閉程式的名稱"), False, True )
前面兩段要先宣告一下~
「Call EndTask(FindWindow(vbNullString, "關閉程式的名稱"), False, True )」如果最後面的布林值為「True」則是「強制」關閉程式~
http://tw.myblog.yahoo.com/cyrex4000/article?mid=780&prev=781&l=f
沒有留言:
張貼留言