My program process.
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: My program process.

Hybrid View

  1. #1
    Join Date
    Mar 2013
    Posts
    13

    My program process.

    When I have a program running.
    And another program kills my programs process.
    Can I detect my process being killed?

    I am trying to detect my programs process being killed.
    So I can clean up (deleting any memory I set aside).

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,301

    Re: My program process.

    It depends upon how your process is being killed. If another program sends/posts WM_CLOSE message (or WM_SYSCOMMAND with SC_CLOSE option) to the main window of your program it is possible to handle closing and provide a cleanup.
    In the case of TerminateProcess no cleanup is possible.
    Victor Nijegorodov

  3. #3
    ovidiucucu's Avatar
    ovidiucucu is offline Moderator/Reviewer Power Poster
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,021

    Re: My program process.

    One aside note: AFAIK, the system frees all resources when the process terminates, so it is not obviously necessary to take care of allocated memory when the process ends unexpectedly.
    Ovidiu Cucu
    "When in Rome, do as Romans do."
    Visit: Microsoft Virtual Academy
    Follow: https://twitter.com/#!/ovidiucucu
    My blog: http://codexpert.ro/blog/author/ovidiu-cucu/

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center