Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. capture "End Process" event

capture "End Process" event

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zecodela
    wrote on last edited by
    #1

    hi, i have a critical application that i need to capture the event if it is being killed by user in taskmgr.exe or being killed by scheduler. i just want to write the event to a log file. how can i capture this event? any good way to do that? thanks, jim

    N 1 Reply Last reply
    0
    • Z zecodela

      hi, i have a critical application that i need to capture the event if it is being killed by user in taskmgr.exe or being killed by scheduler. i just want to write the event to a log file. how can i capture this event? any good way to do that? thanks, jim

      N Offline
      N Offline
      normanS
      wrote on last edited by
      #2

      hi Jim - my internet is really slow, I missed your posting, so I have just posted a similar question! I am trying to log some information when my program exits, which works fine with a normal exit, but I can't get it to work when the user shuts down Windows. Even Notepad knows when Windows shuts down, and asks about saving unsaved work, so it must be possible! I'll let you know if I solve the problem!

      B 1 Reply Last reply
      0
      • N normanS

        hi Jim - my internet is really slow, I missed your posting, so I have just posted a similar question! I am trying to log some information when my program exits, which works fine with a normal exit, but I can't get it to work when the user shuts down Windows. Even Notepad knows when Windows shuts down, and asks about saving unsaved work, so it must be possible! I'll let you know if I solve the problem!

        B Offline
        B Offline
        Blake Miller
        wrote on last edited by
        #3

        See these messages: WM_QUERYENDSESSION WM_POWERBROADCAST WM_POWER WM_ENDSESSION Some others to consider regarding changes to system state: For Terminal Services: WTSRegisterSessionNotification If you have open files: WM_DEVICECHANGE If program is dependent upon screen resolution: WM_DISPLAYCHANGE System settings have been modiifed: WM_SETTINGCHANGE WM_WININICHANGE

        N 1 Reply Last reply
        0
        • B Blake Miller

          See these messages: WM_QUERYENDSESSION WM_POWERBROADCAST WM_POWER WM_ENDSESSION Some others to consider regarding changes to system state: For Terminal Services: WTSRegisterSessionNotification If you have open files: WM_DEVICECHANGE If program is dependent upon screen resolution: WM_DISPLAYCHANGE System settings have been modiifed: WM_SETTINGCHANGE WM_WININICHANGE

          N Offline
          N Offline
          normanS
          wrote on last edited by
          #4

          Thanks - WM_ENDSESSION appears to be the important one for me, but I will look at using WM_POWERBROADCAST and WM_POWER as well.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups