Results 1 to 7 of 7

Thread: Know when a Console app is terminated?

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Know when a Console app is terminated?

    Is there an event or something I could catch that would tell me that my console app is being terminated? Like by Windows being shutdown, etc.

    Thanks
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Know when a Console app is terminated?

    Console applications don't have events or message queues, and I doubt you could even subclass them.

  3. #3
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Know when a Console app is terminated?

    are you talking about something like this?

    http://www.experts-exchange.com/Prog..._21489049.html

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Know when a Console app is terminated?

    Does this event get raised after the window has been closed or after the call has been made for closing it?

  5. #5
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: Know when a Console app is terminated?

    Could the console be re-written as a win service?

  6. #6
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: Know when a Console app is terminated?

    You could run the console application from within your program in a process, then when that process ends, do whatever you want...

    You can check in my sig for a codebank example on automating the command prompt...

  7. #7

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Re: Know when a Console app is terminated?

    Quote Originally Posted by kleinma
    are you talking about something like this?

    http://www.experts-exchange.com/Prog..._21489049.html
    Looks like it, but it doesn't seem to work. Too be continued...

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

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