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. Differentiating SHUTDOWN & RESTART?

Differentiating SHUTDOWN & RESTART?

Scheduled Pinned Locked Moved C / C++ / MFC
question
10 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.
  • K Offline
    K Offline
    Kushagra Tiwari
    wrote on last edited by
    #1

    Is there any way to differentiate programmatically which event is occuring i.e shutdown or restart after catching WM_QUERYENDSESSION?? Regards, Kushagra

    CPalliniC 1 Reply Last reply
    0
    • K Kushagra Tiwari

      Is there any way to differentiate programmatically which event is occuring i.e shutdown or restart after catching WM_QUERYENDSESSION?? Regards, Kushagra

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      See the 'competitor' [^]. :-D

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      In testa che avete, signor di Ceprano?

      K 1 Reply Last reply
      0
      • CPalliniC CPallini

        See the 'competitor' [^]. :-D

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        K Offline
        K Offline
        Kushagra Tiwari
        wrote on last edited by
        #3

        Thanks Sir, It surely will help :) Kushagra

        D 1 Reply Last reply
        0
        • K Kushagra Tiwari

          Thanks Sir, It surely will help :) Kushagra

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

          Kushagra Tiwari wrote:

          It surely will help

          Knowing how Windows was last shut down is helpful?

          "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          K 1 Reply Last reply
          0
          • D David Crow

            Kushagra Tiwari wrote:

            It surely will help

            Knowing how Windows was last shut down is helpful?

            "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            K Offline
            K Offline
            Kushagra Tiwari
            wrote on last edited by
            #5

            DavidCrow wrote:

            Knowing how Windows was last shut down is helpful?

            Hi David, Indeed it is helpful : For eg: User A pressed 'Restart' on the 'Shutdown Windows ' dialog. My application recieves WM_QUERYENDSESSION message and I return false (means I am temorarily delaying the shutdown) , but WM_QUERYENDSESSION never lets me differentiate between a 'Shutdown' & 'Restart'. Now, in this time after my application has completed its work it wants to continue with the operation that user chose then this registry value is one thing that lets me know whether the user tried 'Shutdown' or 'Restart', thus accordingly I can perform his desired operation :) . Regards Kushagra I hate coding but I luv to Develop :)

            D 1 Reply Last reply
            0
            • K Kushagra Tiwari

              DavidCrow wrote:

              Knowing how Windows was last shut down is helpful?

              Hi David, Indeed it is helpful : For eg: User A pressed 'Restart' on the 'Shutdown Windows ' dialog. My application recieves WM_QUERYENDSESSION message and I return false (means I am temorarily delaying the shutdown) , but WM_QUERYENDSESSION never lets me differentiate between a 'Shutdown' & 'Restart'. Now, in this time after my application has completed its work it wants to continue with the operation that user chose then this registry value is one thing that lets me know whether the user tried 'Shutdown' or 'Restart', thus accordingly I can perform his desired operation :) . Regards Kushagra I hate coding but I luv to Develop :)

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

              Have you verified that the registry is updated with the 'restart' flag even though no restart was performed?

              "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

              "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

              K 2 Replies Last reply
              0
              • D David Crow

                Have you verified that the registry is updated with the 'restart' flag even though no restart was performed?

                "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

                "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                K Offline
                K Offline
                Kushagra Tiwari
                wrote on last edited by
                #7

                Yes david .. It works perfectly fine .. I have verified it just now :)

                1 Reply Last reply
                0
                • D David Crow

                  Have you verified that the registry is updated with the 'restart' flag even though no restart was performed?

                  "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

                  "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                  K Offline
                  K Offline
                  Kushagra Tiwari
                  wrote on last edited by
                  #8

                  Did you try to cross verify it ??

                  D 1 Reply Last reply
                  0
                  • K Kushagra Tiwari

                    Did you try to cross verify it ??

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

                    No, why would I?

                    "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

                    "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                    K 1 Reply Last reply
                    0
                    • D David Crow

                      No, why would I?

                      "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

                      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                      K Offline
                      K Offline
                      Kushagra Tiwari
                      wrote on last edited by
                      #10

                      I thought u must have tried it before, thats why u mast have asked the question of verifying. Anyways , thanks for the help. :) Kushagra

                      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