🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #2691

Re: Detect Hibernate

#2691
From: Remy Lebeau (TeamB)
Date: Fri, 05 Jan 2007 21:55
25 lines
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
Technical Details
Message-ID: <459ec936$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!news.albasani.net!feeder06.uucp-net.de!reader.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mail
References: <459ec011$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,d767b1d91074b232
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <459ec011$1@newsgroups.borland.com>
Subject: Re: Detect Hibernate
Date: Fri, 5 Jan 2007 13:55:59 -0800
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 75.83.34.171
Message-ID: <459ec936$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1168034102 75.83.34.171 (5 Jan 2007 13:55:02 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!news.albasani.net!feeder06.uucp-net.de!reader.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mail