Closing a different application


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Closing a different application

  1. #1
    Magnus Guest

    Closing a different application


    Anyone who knows a descent way to properly close another application? I've
    been struggling with a number of api's such as TerminateProcess and more.

    I need the shutdown to properly notify any DLL's so there aren't any garbage
    left in memory. ExitProcess seems to do the job but how??? It only shut down
    the process where I call it from.

    TerminateProcess works but it seems to be a violent way to shut down.



  2. #2
    Jim Deutch Guest

    Re: Closing a different application

    The polite way is to PostMessage() its main window with a WM_CLOSE.

    Jim Deutch
    MS Dev MVP

    Magnus wrote in message <390957f4$1@news.devx.com>...
    >
    >Anyone who knows a descent way to properly close another application? I've
    >been struggling with a number of api's such as TerminateProcess and more.
    >
    >I need the shutdown to properly notify any DLL's so there aren't any

    garbage
    >left in memory. ExitProcess seems to do the job but how??? It only shut

    down
    >the process where I call it from.
    >
    >TerminateProcess works but it seems to be a violent way to shut down.
    >
    >




  3. #3
    Jim Deutch Guest

    Re: Closing a different application

    The polite way is to PostMessage() its main window with a WM_CLOSE.

    Jim Deutch
    MS Dev MVP

    Magnus wrote in message <390957f4$1@news.devx.com>...
    >
    >Anyone who knows a descent way to properly close another application? I've
    >been struggling with a number of api's such as TerminateProcess and more.
    >
    >I need the shutdown to properly notify any DLL's so there aren't any

    garbage
    >left in memory. ExitProcess seems to do the job but how??? It only shut

    down
    >the process where I call it from.
    >
    >TerminateProcess works but it seems to be a violent way to shut down.
    >
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center