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. How to run an application when clicking "Shut Down" from start menu?

How to run an application when clicking "Shut Down" from start menu?

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
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.
  • J Offline
    J Offline
    jahfer
    wrote on last edited by
    #1

    Hello, I am using Windows 2000 Professional and VC++ 6.0 (MFC). I have created a simple dialog based application. I want to run this application when I click "Shut Down" from start menu. How to achieve this? TIA, Regards, Jahfer V P

    D 1 Reply Last reply
    0
    • J jahfer

      Hello, I am using Windows 2000 Professional and VC++ 6.0 (MFC). I have created a simple dialog based application. I want to run this application when I click "Shut Down" from start menu. How to achieve this? TIA, Regards, Jahfer V P

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      You would need a separate application running that handles the WM_QUERYENDSESSION message. When that message is received, return 0, start the "dialog based application."


      "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

      R 1 Reply Last reply
      0
      • D David Crow

        You would need a separate application running that handles the WM_QUERYENDSESSION message. When that message is received, return 0, start the "dialog based application."


        "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

        R Offline
        R Offline
        r i s h a b h s
        wrote on last edited by
        #3

        But, would the os allow launching a process when its in the process of shutdown? I think you have to abort the shutdown first, launch your application and call ExitWindows(...) again. ____________________________________________________________ rishabhs I think therefore I am.

        D 1 Reply Last reply
        0
        • R r i s h a b h s

          But, would the os allow launching a process when its in the process of shutdown? I think you have to abort the shutdown first, launch your application and call ExitWindows(...) again. ____________________________________________________________ rishabhs I think therefore I am.

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          r i s h a b h s wrote: I think you have to abort the shutdown first, launch your application... Which is exactly what I suggested.


          "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

          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