Thread View: borland.public.cppbuilder.nativeapi
3 messages
3 total messages
Started by qyte
Fri, 05 Jan 2007 21:16
Detect Hibernate
Author: qyte
Date: Fri, 05 Jan 2007 21:16
Date: Fri, 05 Jan 2007 21:16
2 lines
869 bytes
869 bytes
Is there a way to detect if hibernate is enabled? Even better if i could enable/disable it from my app.
Re: Detect Hibernate
Author: Ed Mulroy
Date: Fri, 05 Jan 2007 21:51
Date: Fri, 05 Jan 2007 21:51
15 lines
1467 bytes
1467 bytes
I don't know offhand if you get to see if suspend or hibernate is enabled. It seems that all or at least most of the time it is already suspended before entering hibernate. Look at the power management API, where a WM_POWERBROADCAST message is sent. http://msdn2.microsoft.com/en-us/library/aa373248.aspx . Ed > qyte wrote in message > news:459ec011$1@newsgroups.borland.com... > > Is there a way to detect if hibernate is enabled? > Even better if i could enable/disable it from my app.
Re: Detect Hibernate
Author: Remy Lebeau (TeamB)
Date: Fri, 05 Jan 2007 21:55
Date: Fri, 05 Jan 2007 21:55
25 lines
1806 bytes
1806 bytes
"qyte" <gyte@vivodinet.gr> wrote in message
news:459ec011$1@newsgroups.borland.com...
> Is there a way to detect if hibernate is enabled?
The only functions I know of are CallNtPowerInformation() and
IsPwrHibernateAllowed():
http://msdn2.microsoft.com/en-us/library/aa372675.aspx
http://msdn2.microsoft.com/en-us/library/aa372705.aspx
> Even better if i could enable/disable it from my app.
You can't enable/disable hibernation. What you can do, however, is
intercept the WM_POWERBROADCAST message. Check for the
PBT_APMQUERYSUSPEND event, and return BROADCAST_QUERY_DENY in
response.
Something else to keep in mind - starting with Windows Vista, you
can't block power management operations anymore. So you may want to
re-think why you are trying to disable hibernation in the first place.
Gambit
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads