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 get ShutdownBlockReasonCreate for windows vista?

How to get ShutdownBlockReasonCreate for windows vista?

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

    Hello, I had made an application which trapped WM_QUERYSESSION to block SHUTDOWN and LOGOFF in Windows XP. When Trying to port this solution on VISTA/WINDOWS 2008/Windows 7 I need to call additional methods namely ShutdownBlockReasonCreate() , ShutdownBlockReasonDestroy() which is defined in winuser.h for VISTA. After installing VS 2005 and upgrading it for windows VISTA by SP1 , I am still not getting ShutdownBlockReasonCreate () in windows vista winuser.h. Please let me know where am I doing things wrong . Regards, Kushagra I hate coding but I luv to develop :)

    S _ 2 Replies Last reply
    0
    • K Kushagra Tiwari

      Hello, I had made an application which trapped WM_QUERYSESSION to block SHUTDOWN and LOGOFF in Windows XP. When Trying to port this solution on VISTA/WINDOWS 2008/Windows 7 I need to call additional methods namely ShutdownBlockReasonCreate() , ShutdownBlockReasonDestroy() which is defined in winuser.h for VISTA. After installing VS 2005 and upgrading it for windows VISTA by SP1 , I am still not getting ShutdownBlockReasonCreate () in windows vista winuser.h. Please let me know where am I doing things wrong . Regards, Kushagra I hate coding but I luv to develop :)

      S Offline
      S Offline
      sashoalm
      wrote on last edited by
      #2

      In the *.cpp files where you call these functions paste somewhere at the beginning (but after #include stdafx.h):

      BOOL WINAPI ShutdownBlockReasonDestroy(
      __in HWND hWnd
      );

      BOOL WINAPI ShutdownBlockReasonCreate(
      __in HWND hWnd,
      __in LPCWSTR pwszReason
      );

      There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

      1 Reply Last reply
      0
      • K Kushagra Tiwari

        Hello, I had made an application which trapped WM_QUERYSESSION to block SHUTDOWN and LOGOFF in Windows XP. When Trying to port this solution on VISTA/WINDOWS 2008/Windows 7 I need to call additional methods namely ShutdownBlockReasonCreate() , ShutdownBlockReasonDestroy() which is defined in winuser.h for VISTA. After installing VS 2005 and upgrading it for windows VISTA by SP1 , I am still not getting ShutdownBlockReasonCreate () in windows vista winuser.h. Please let me know where am I doing things wrong . Regards, Kushagra I hate coding but I luv to develop :)

        _ Offline
        _ Offline
        _Superman_
        wrote on last edited by
        #3

        Download and install the latest Windows SDK from Windows SDK for Windows Server 2008 and .NET Framework 3.5[^]. Then run the Windows SDK Configuration Tool from Start -> All Programs -> Microsoft Windows SDK v6.1 -> Visual Studio Registration to integrate it with Visual Stdio.

        «_Superman_» I love work. It gives me something to do between weekends.
        Microsoft MVP (Visual C++)

        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