Results 1 to 4 of 4

Thread: Shutdown Options.

  1. #1
    Newbie
    Join Date
    Mar 2005
    Location
    Florida
    Posts
    53

    Shutdown Options.

    Hey Guino, thanks again for all the great work!

    Any chance that we could have both Sleep, and Hibernate as options from the shutdown menu.

    Sleep works great for me except when I have it sleep over night. Then it doesn't want to come out. (common windows problem) but for short stops, (3 hours or less) it works great.

  2. #2
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,817
    Quote Originally Posted by stoodo
    Hey Guino, thanks again for all the great work!
    Any chance that we could have both Sleep, and Hibernate as options from the shutdown menu.
    Sleep works great for me except when I have it sleep over night. Then it doesn't want to come out. (common windows problem) but for short stops, (3 hours or less) it works great.
    I am not sure how to do it using Windows API.. If you disable Hibernate support in Control panel, a "Sleep" (Formerly Stand-By) will happen when you ask the system to hibernate.. I have to see whether it's possible..
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

  3. #3
    FLAC
    Join Date
    Sep 2004
    Posts
    1,577
    Either of these should work:
    Code:
    SetSuspendState
    
    The SetSuspendState function suspends the system by shutting power down. Depending on the Hibernate parameter, the system either enters a suspend (sleep) state or hibernation (S4).
    
    
    BOOLEAN SetSuspendState(
      BOOL Hibernate,
      BOOL ForceCritical,
      BOOL DisableWakeEvent
    );
    
    Parameters
    Hibernate 
    [in] If this parameter is TRUE, the system hibernates. If the parameter is FALSE, the system is suspended. 
    ForceCritical 
    [in] If this parameter is TRUE, the system suspends operation immediately; if it is FALSE, the system broadcasts a PBT_APMQUERYSUSPEND event to each application to request permission to suspend operation. 
    DisableWakeEvent 
    [in] If this parameter is TRUE, the system disables all wake events. If the parameter is FALSE, any system wake events remain enabled.
    Code:
    SetSystemPowerState
    
    The SetSystemPowerState function suspends the system by shutting power down. Depending on the ForceFlag parameter, the function either suspends operation immediately or requests permission from all applications and device drivers before doing so.
    
    
    BOOL SetSystemPowerState(
      BOOL fSuspend,
      BOOL fForce
    );
    
    Parameters
    fSuspend 
    [in] If this parameter is TRUE, the system is suspended. If the parameter is FALSE, the system hibernates. 
    Windows Me/98/95:  Ignored.
    fForce 
    [in] If this parameter is TRUE, the function broadcasts a PBT_APMSUSPEND event to each application and driver, then immediately suspends operation. If the parameter is FALSE, the function broadcasts a PBT_APMQUERYSUSPEND event to each application to request permission to suspend operation. Return Values
    If power has been suspended and subsequently restored, the return value is nonzero.
    
    If the system was not suspended, the return value is zero. To get extended error information, call GetLastError.
    
    Remarks
    The calling process must have the SE_SHUTDOWN_NAME privilege. To enable the SE_SHUTDOWN_NAME privilege, use the AdjustTokenPrivileges function. For more information, see Changing Privileges in a Token.
    
    If any application or driver denies permission to suspend operation, the function broadcasts a PBT_APMQUERYSUSPENDFAILED event to each application and driver. If power is suspended, this function returns only after system operation is resumes and related WM_POWERBROADCAST messages have been broadcast to all applications and drivers.
    
    This function is similar to the SetSuspendState function.
    
    To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0400 or later. For more information, see Using the Windows Headers.
    http://msdn.microsoft.com/library/de..._functions.asp
    Progress: 80% - Permanent install left.
    Motion LS800 Tablet PC and dock.
    Vista, Bu-535 GPS, RoadRunner, MPT2006.

  4. #4
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,817
    I guess I just overlooked that then... never really did much research for the hibernate function.. I'll add a suspend option.
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

Similar Threads

  1. Shutdown cmd options
    By slarty in forum FrodoPlayer
    Replies: 7
    Last Post: 01-20-2005, 09:57 AM
  2. no windows shutdown options
    By djmickyg in forum General Hardware Discussion
    Replies: 15
    Last Post: 12-15-2004, 11:30 PM
  3. Shutdown controller options?
    By Kamakazie2 in forum Power Supplies
    Replies: 3
    Last Post: 04-20-2004, 01:46 AM
  4. New Improved ATX Shutdown Unit!
    By Danceheaven in forum General Hardware Discussion
    Replies: 22
    Last Post: 04-15-2004, 09:52 PM
  5. Win2k quick shutdown options?
    By blkdragon6 in forum Software & Software Development
    Replies: 11
    Last Post: 11-14-2000, 12:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •