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. Windows shutdown

Windows shutdown

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 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.
  • R Offline
    R Offline
    rw104
    wrote on last edited by
    #1

    hello, I want to prevent user shutdown. I am catching the WM_QUERYENDSESSION message and returning a 1, which occording to the inline help should stop the shutdown process. It works on occassions but crashes on others, it seems to be completely inconsistent too...I know i am cathing the WM_QUERYENDSESSION so its not anything else... Is there something else I need to do??? Thanks in advance

    D K 2 Replies Last reply
    0
    • R rw104

      hello, I want to prevent user shutdown. I am catching the WM_QUERYENDSESSION message and returning a 1, which occording to the inline help should stop the shutdown process. It works on occassions but crashes on others, it seems to be completely inconsistent too...I know i am cathing the WM_QUERYENDSESSION so its not anything else... Is there something else I need to do??? Thanks in advance

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

      rw104 wrote: I am catching the WM_QUERYENDSESSION message and returning a 1, which occording to the inline help should stop the shutdown process. I believe that should be a 0.


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

      1 Reply Last reply
      0
      • R rw104

        hello, I want to prevent user shutdown. I am catching the WM_QUERYENDSESSION message and returning a 1, which occording to the inline help should stop the shutdown process. It works on occassions but crashes on others, it seems to be completely inconsistent too...I know i am cathing the WM_QUERYENDSESSION so its not anything else... Is there something else I need to do??? Thanks in advance

        K Offline
        K Offline
        KaRl
        wrote on last edited by
        #3

        rw104 wrote: I am catching the WM_QUERYENDSESSION message and returning a 1, which occording to the inline help should stop the shutdown process. Hum, I don't get the same info in MSDN: From MSDN, Platform SDK: Windows System Information "Return Values If an application can terminate conveniently, it should return TRUE; otherwise, it should return FALSE. Remarks By default, the DefWindowProc function returns TRUE for this message. Windows NT/2000/XP: When an application returns TRUE for this message, it receives the WM_ENDSESSION message and it is terminated, regardless of how the other applications respond to the WM_QUERYENDSESSION message. Windows 95/98/Me: After all applications return TRUE for this message, they receive the WM_ENDSESSION and they are terminated. " HTH, K.


        And I'm talking to myself at night because I can't forget Back and forth through my mind Behind a cigarette

        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