what code would you use to close msmsgs.exe process even if it is just running in the background?
Printable View
what code would you use to close msmsgs.exe process even if it is just running in the background?
This is the code to find MSN and close it but i don't know the classname and the windowname doesn't work if its not visible. So good luck :)
VB Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Const SW_SHOWNORMAL = 1 Const WM_CLOSE = &H10 Private Sub Form_Load() Dim WinWnd As Long WinWnd = FindWindow(Classname, Windowname) PostMessage WinWnd, WM_CLOSE, 0&, 0& End Sub