To get extended error information, call GetLastError.Īn application may use SetSuspendState to transition the system from the working state to the standby (sleep), or optionally, hibernate (S4) state. If the function fails, the return value is zero. If the function succeeds, the return value is nonzero. If FALSE, any system wake events remain enabled. If TRUE, the system disables all wake events. If FALSE, the function broadcasts a PBT_APMQUERYSUSPEND event to each application to request permission to suspend operation. If TRUE, the function broadcasts a PBT_APMSUSPEND event to each application and driver, then immediately suspends operation. If the ForceFlag parameter is TRUE, the system suspends operation immediately if it is FALSE, the system requests permission from all applications and device drivers before doing so. Depending on the Hibernate parameter, the system either enters a suspend (sleep) state or hibernation (S4). The SetSuspendState function suspends the system by shutting power down. So it's treating boolHibernate as 0 so can't suspend only hibernate. As we're passing Null, Null, Null (because it's an ordinary function that doesn't expect to be called from a command line but by a program) to a function that expects values. Note I can't guarantee it will always work.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |