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. run at shutdown ...

run at shutdown ...

Scheduled Pinned Locked Moved C / C++ / MFC
windows-adminperformancequestion
17 Posts 6 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.
  • D David Crow

    The problem with the WM_QUERYENDSESSION message is that an application can return 0 in response to it and Windows will not shut down.


    "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

    J Offline
    J Offline
    jmkhael
    wrote on last edited by
    #8

    Exactly what he may need if he want to do some processing and then call the ExitWindow family of API Papa while (TRUE) Papa.WillLove ( Bebe ) ;

    D 1 Reply Last reply
    0
    • J jmkhael

      Exactly what he may need if he want to do some processing and then call the ExitWindow family of API Papa while (TRUE) Papa.WillLove ( Bebe ) ;

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

      If, during the processing of the WM_QUERYENDSESSION message, a call is made to ExitWindows[Ex](), does that not re-send the WM_QUERYENDSESSION message? As I read Alex's original post, he was interested in doing something if Windows was shutting down, not if Windows was asked to be shut down. If work was done during the processing of WM_QUERYENDSESSION, it is not guaranteed that Windows will shut down, thus the processing may be immature.


      "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

      J T 2 Replies Last reply
      0
      • D David Crow

        If, during the processing of the WM_QUERYENDSESSION message, a call is made to ExitWindows[Ex](), does that not re-send the WM_QUERYENDSESSION message? As I read Alex's original post, he was interested in doing something if Windows was shutting down, not if Windows was asked to be shut down. If work was done during the processing of WM_QUERYENDSESSION, it is not guaranteed that Windows will shut down, thus the processing may be immature.


        "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

        J Offline
        J Offline
        jmkhael
        wrote on last edited by
        #10

        You're right Papa while (TRUE) Papa.WillLove ( Bebe ) ;

        1 Reply Last reply
        0
        • D David Crow

          Alex HexR wrote: ...although application should be whole time in memory. Which is not what you indicated in your original post. "There is no reason to keep it during whole session in memory" is not the same as "although application should be whole time in memory." Alex HexR wrote: not a big deal, dos times are over and we have enough memory This make no sense whatsoever. What does DOS and enough memory have to do with your post or my reply? You wanted to know when Windows was shutting down so that you could check some things. WM_ENDSESSION is the message you'll need to handle to know that Windows is shutting down.


          "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

          RaviBeeR Offline
          RaviBeeR Offline
          RaviBee
          wrote on last edited by
          #11

          DavidCrow wrote: dos times are over "dos" -> "those", methinks. :) /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

          D 1 Reply Last reply
          0
          • RaviBeeR RaviBee

            DavidCrow wrote: dos times are over "dos" -> "those", methinks. :) /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

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

            I'm unclear on your intent here as none of my posts in this thread mentioned anything about "dos times are over."


            "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

            RaviBeeR 1 Reply Last reply
            0
            • D David Crow

              I'm unclear on your intent here as none of my posts in this thread mentioned anything about "dos times are over."


              "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

              RaviBeeR Offline
              RaviBeeR Offline
              RaviBee
              wrote on last edited by
              #13

              I was referring to Alex's post. I think he meant "those times are over", where as you interpreted his misspelling as having to do with DOS. /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

              D 1 Reply Last reply
              0
              • RaviBeeR RaviBee

                I was referring to Alex's post. I think he meant "those times are over", where as you interpreted his misspelling as having to do with DOS. /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

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

                Nothing was misspelled. He clearly meant DOS.


                "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

                RaviBeeR 1 Reply Last reply
                0
                • D David Crow

                  Nothing was misspelled. He clearly meant DOS.


                  "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

                  RaviBeeR Offline
                  RaviBeeR Offline
                  RaviBee
                  wrote on last edited by
                  #15

                  OK. It just didn't appear that way to me. We're both talking about this msg[^], right? /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

                  D 1 Reply Last reply
                  0
                  • RaviBeeR RaviBee

                    OK. It just didn't appear that way to me. We're both talking about this msg[^], right? /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

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

                    Ravi Bhavnani wrote: We're both talking about this msg[^], right? Correct.


                    "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

                    1 Reply Last reply
                    0
                    • D David Crow

                      If, during the processing of the WM_QUERYENDSESSION message, a call is made to ExitWindows[Ex](), does that not re-send the WM_QUERYENDSESSION message? As I read Alex's original post, he was interested in doing something if Windows was shutting down, not if Windows was asked to be shut down. If work was done during the processing of WM_QUERYENDSESSION, it is not guaranteed that Windows will shut down, thus the processing may be immature.


                      "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

                      T Offline
                      T Offline
                      toxcct
                      wrote on last edited by
                      #17

                      so, as i understand Alex's question (or even if it is not his, it's mine :-D), is there a way to lauch a program which is not executing when windows shuts down (and so don't use memory for nothing - because it is not needed before the loggout) ? the problem is, when you catch the WM_ENDSESSION , the program must be currently running to catch the event...


                      TOXCCT >>> GEII power

                      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