Results 1 to 3 of 3

Thread: close application

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2004
    Location
    Canada
    Posts
    71

    close application

    what code would you use to close msmsgs.exe process even if it is just running in the background?

  2. #2
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: close application

    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:
    1. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    2. 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
    3. Const SW_SHOWNORMAL = 1
    4. Const WM_CLOSE = &H10
    5. Private Sub Form_Load()
    6.     Dim WinWnd As Long
    7.     WinWnd = FindWindow(Classname, Windowname)
    8.     PostMessage WinWnd, WM_CLOSE, 0&, 0&
    9. End Sub

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width