Determining if hibernation is enabled

Hi,

I'm using SetSuspendState(TRUE, FALSE, FALSE) to put the pc in into 
hibernation, which only works if hibernation is enabled.

How can I determine whether hibernation is enabled before calling, so I can 
report as much to my users?

I'm working with VS2008, targetting XP and Vista.

Thanks,
Steph
0
steph8758 (33)
10/20/2008 8:31:01 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
1047 Views

Similar Articles

[PageSpeed] 23

IsPwrHibernateAllowed\ GetPwrCapabilities or
CallNtPowerInformation(Maybe it's better way)

"Steph" <steph@newsgroups.nospam> д����Ϣ 
news:92169931-7711-41D8-A88E-6C6092343D40@microsoft.com...
> Hi,
>
> I'm using SetSuspendState(TRUE, FALSE, FALSE) to put the pc in into
> hibernation, which only works if hibernation is enabled.
>
> How can I determine whether hibernation is enabled before calling, so I 
> can
> report as much to my users?
>
> I'm working with VS2008, targetting XP and Vista.
>
> Thanks,
> Steph 


0
asctime (5)
10/20/2008 9:48:25 AM
Thank you. 

SYSTEM_POWER_CAPABILITIES .HiberFilePresent did the trick

regards,
Steph

"Bin" wrote:

> IsPwrHibernateAllowed\ GetPwrCapabilities or
> CallNtPowerInformation(Maybe it's better way)
> 
> "Steph" <steph@newsgroups.nospam> дÈëÏûÏ¢ 
> news:92169931-7711-41D8-A88E-6C6092343D40@microsoft.com...
> > Hi,
> >
> > I'm using SetSuspendState(TRUE, FALSE, FALSE) to put the pc in into
> > hibernation, which only works if hibernation is enabled.
> >
> > How can I determine whether hibernation is enabled before calling, so I 
> > can
> > report as much to my users?
> >
> > I'm working with VS2008, targetting XP and Vista.
> >
> > Thanks,
> > Steph 
> 
> 
> 
0
steph8758 (33)
10/23/2008 10:43:01 AM
Reply:

Similar Artilces:

Mail Enabled User Not Appearing on GAL
Hey folks. Strange query.. using Win2K3Ent and Exch2k3Ent, with latest SPs and hotfixes installed on both. Trying to create a mail-enabled user (giving impression of internal user actually aliased to an external SMTP address). I'm under the impression (confirmed by checking 70-284) that a mail-enabled user should appear in the GAL after a short while, and be available for clients such as Outlook to select directly (yet be aliased at the postoffice level). No matter what I try, I cannot get the user to appear in the GAL. Using ExchSysMgr, if I query the GAL, the user appears happ...

determine mail flow problem!!!!!!!!
Help! :-( Our mailflow from 2 backend 2003 exchange servers keeps queuing up in the outbound queue (which is set to always run delivery). Messages stay in there from 10 to 120 minutes before being sent to our gateway MTA and then sent off site (to hotmail.com for example). However when I telnet from a backend server to the gateway over port 25 and send a test message it goes right away. I can't for the life of me figure out why. One example when viewed in message tracking history says: 10:16am - smtp: store driver, message submitted from store 10:16am - smtp: message submitted to ...

Enable script in powershell with GPO
By default, PowerShell comes with scripting disabled, I know that I fix this with the command: set-executionpolicy unrestricted But how to set this in AD (GPO) for this command to run on all the stations? Thank=B4s What do you run as AD servers and on what systems would you want to set this? Check this: http://www.microsoft.com/downloads/details.aspx?FamilyID=2917a564-dbbc-4da7-82c8-fe08b3ef4e6d&displaylang=en Marco "PedroCesar" <tecdom@gmail.com> wrote in message news:dfa4965d-f3b4-442f-bf33-e94927517eff@r5g2000yqb.googlegroups.com... > By ...

Determine columns used
I have 100+ spreadsheets which i have to edit into a certain format. The spreadsheets currently have 100 columns (from 1-100). From there i have to reduce the number of columns set to 8 columns. E.g: 1 2 3 4 5 6 7 8 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 (from column 9 onwards, it goes to the 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 next rows' column 1) 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 How do i do that without altering the order of the value of the cell? Let me make sure we understand the question. You have ...

Dynamically determining when a month ends
Hello all, Ok, I have a simple excel spreadsheet, where I keep track of my spending on one tab, my income in another and my summary in a thrid. My problem happens when I try to dynamically calc. avg's for months in the summary page. For instance, if I want to see how much money I spent on average per month, or even per day, I draw from the data entered into the spending page. Now, the spending page is set up with the following columns: Date:: Description:: Amount The problem with this is that I can't predefine a max row # for each month, since I might have 80 entries in spending...

how to determine the size of the sheet
Hi I had a collegue who told me once a way to dtermine the number of the rows in a sheet of the workbook I am working at. It is known that when you open a new workbook each sheet has maybe 65365 or something like that rows. MY QUESTION IS: HOW TO MAKE THE SHEET 1000 ROWS OR WHATEVER NUMBERS OF ROWS I ONLY NEED? Thanks in Advance, Ahmed Hi Ahmed The number of rows and columns are fixed. Your workaround would be to hide the ones you consider unneeded. HTH. Best wishes Harald "Ahmed SHEBL" <ahmad.shebl@hotmail.com> skrev i melding news:%231uFO3IcHHA.4720@TK2MSFTNGP0...

how to enable Outlook to start in Online mode
Hi, I use MS Outlook 2007 in Cache Server Mode. To troubleshoot some performance problem i was facing I tried switching to 'Work Offline' mode. the problem is, now whenever I launch Outlook it loads in Offline mode. I have tried going online and then exiting outlook to see if subsequently it would load in the last state (Online) it was exited but to no avail. I would really appreciate if someone can guide me how to change the outlook Startup settings. Regards, Nabeel fixed using the following settings Tools -> account Settings -> Edit Microsoft Exchange account -> More se...

How do I determine
I have X number of rows that show employee names and a column (A2) that lists the value of products sold by each employee and I want to pay them a percentage based upon value of sales. For example: If they sell up to =A31,000 worth of products, I will pay them 3% of the value. Between =A31,000 & =A32,000, I will pay them 5% of the value Over =A32,000, I will pay them 10% of the value The amount paid to them in commission will be show in column (A3). Many thanks D.Haste darren.haste@ttt.co.uk "Hastey" <darrenhaste@sky.com> wrote in message news:6a0a4fa9-adcd-484a-80...

How do you determine if you have access to remote files
I'm trying to scan a list of servers for a specific file (say for example \\<servername>\C$\MyApp\Test.ini\which may exist on some servers but not on others. In addition, I may not have have access to all servers that I'm checking. When using any commands in Powershell (1.0) that attempt to get the file (such as Get-Item) PowerShell returns the same "Cannot find path '<filename>' because it does not exist.)" error message in the following two scenarions: 1. I have access to the remote filesystem and the file does not exist (expected beha...

Determining A Rating
Hello, Suppose I have the following table: A B C 1 3 <3.80 2 3- 3.80 3.99 3 4+ 4.00 4.19 4 4 4.20 4.79 5 4- 4.80 4.99 6 5+ 5.00 5.19 7 5 5.20 5.79 8 5- 5.80 5.99 9 6+ 6.00 6.19 10 6 6.20 6.79 11 6- 6.80 6.99 12 7 7.50 7.99 13 8 8.50 8.99 14 15 4.91 16 4- Where A is a rating/score B is the low value range C is the high value range If I have a value in A15 of 4.91 (which is in the range of 4.80 and 4.99), I would like to return a rating in A16 of 4-. I've tried using a series of IF statements, ...

How do I determine the size of an excel worksheet?
How do I determine the size of an individual worksheet in an Office Excel 2003 file? The Properties featue only tells me the size of the whole file. Hi not directly supported by Excel. One workaround: Export this sheet to a separate workbook (with only this sheet) and measure its size -- Regards Frank Kabel Frankfurt, Germany "rajivsahib" <rajivsahib@discussions.microsoft.com> schrieb im Newsbeitrag news:7031AE58-EB7A-44CD-9AF5-940BD47DAA8B@microsoft.com... > How do I determine the size of an individual worksheet in an Office Excel > 2003 file? The Properties featue o...

Determine if a sheet is protected?
How can I determine if a sheet is protected or not? thank u Try activesheet.protectcontents HTH Bob "Robert Crandal" <nobody@gmail.com> wrote in message news:h865n.9557$Ft3.8620@newsfe04.iad... > How can I determine if a sheet is protected or not? > > thank u > > Sub test() MsgBox ActiveSheet.ProtectionMode 'returns true or false End Sub Gord Dibben MS Excel MVP On Mon, 18 Jan 2010 16:28:18 -0700, "Robert Crandal" <nobody@gmail.com> wrote: >How can I determine if a sheet is protected o...

Enabling Arabic numerals in Excel
I'm hoping someone can help! I am running MS Office 2003 on Windows XP and have Arabic enabled and working perfectly throughout my Office 2003 applications, with one exception. I cannot get Excel to use Arabic numerals. I have tried everything I've found on this so far - mainly relating to setting the text direction to 'context' in slightly different ways. The principle of this worked in Word, but doesn't work for me in Excel. I am getting somewhat frustrated and hope someone else has an idea of what I am doing wrong! Thanks a million in advance orpheus Please clarify ...

Enabling forwarding in Exchange 2007
In Exchange 2007, I have created a Mail contact with a custom SMTP address as "administrator@1.2.3.4" I have set client-side rule in Outlook, to forward all the incoming mails to this exterrnal SMTP server ("administrator@1.2.3.4" ). To this to work, I need to enable forwarding on Exchange 2007 server. Please let me know how to do it. I tried enabling the following, but that did not help. "Exchange Mgmt Console --> Expand Org Config --> Select Hub Transport --> Select Remote Domains Tab --> Right Click Default and Select Properties --> Select Message F...

Determining OS?
Is there a method to determine the operating system (98, XP, ME, etc) that a program is running under? Thanks, -- Knute Johnson email s/nospam/knute/ Molon labe... >Is there a method to determine the operating system (98, XP, ME, etc) >that a program is running under? See the GetVersionEx API. Dave -- MVP VC++ FAQ: http://www.mvps.org/vcfaq David Lowndes wrote: >>Is there a method to determine the operating system (98, XP, ME, etc) >>that a program is running under? > > > See the GetVersionEx API. > > Dave Thanks. -- Knute Johnson email s/n...

Computer does not go into hibernation
In Power Options I enabled hibernation and asked the computer to go into = hibernation after 30 minutes. Well, it doesn't.=20 The complete settings are as follows: Turn off monitor: after 5 min. Turn off hard disks: after 15 minutes. System standby: after 25 minutes. System hibernates: after 30 minutes. What may be the reason of the computer not going into hibernation? TIA Humpty Usually something running in the background. Are you running a virus program that starts when the computer is idle? "Humpty Dumpty" <sorry@antispam.net> wrote in messa...

Convert to mail-enabled account
Can someone point me to docs detailing how to convert an existing login account (not mai enabled) to a mail-enabled, or mailbox-enabled account usinf LDIFDE? I need to do a lot of these, and want to do it in bulk. I'm running Exchange 2003, on Windows 2003. Thank you. Ed I'm not sure that you can use LDIFDE to mail-enable a user. Then again, I haven't tried it before. However, you *can* select multiple users within ADUC and right-click, choose Exchange Tasks, then choose create mailbox. -- Ben Winzenz Exchange MVP MessageOne "Ed" <ed.jackson@americantowe...

Other field Determination
Imagine this situation...there are: Owners (tblOwners) Pets (tblPets, child records of tblOwners) Medicines (tblMeds, child records of tblPets) Owners can have multiple pets. Pets have multiple medicines. Easy so far. Here's the tricky part. The Pets can be of different species (cat, dog, bird, snake, etc). Depending on what the species is, I want to determine the other data that needs to be stored for the pet. So instead of just height, weight, age, as fields in the pet table, I want to see number of whiskers, declawed? if its a cat...wingspan, beaklength, feather color if its a bi...

How to determine Resources for a ServiceAppointment?
I am creating a custom view to list resources for each serviceappointment. Here is the basic query I have used that seems to produce the correct results: SELECT * FROM serviceappointment JOIN ActivityParty ON (ServiceAppointment.ActivityId = ActivityParty.ActivityId) AND (ActivityParty.PartyObjectTypeCode = 112) JOIN systemuser ON (ActivityParty.OwningUser = systemuser.systemuserid) WHERE (serviceappointment.StateCode <> 2) My question is why ObjectTypeCode = 112. Isn't that for Incident, not for ServiceAppointment? Can anyone clarify for me please? Thanks, Richard ...

Determining a Date
I have a column which is title, Expected Completition Date. Therefore multiple dates can be used. For example, July 1, July 17, August 31, August, 9, September 16, August 2, July 31, in that order. So for this project to be completed, it would be on September 16. I want the total field at the bottom to display the latest date of completion. =MAX(range) -- Carlos "Mark" <Mark@discussions.microsoft.com> wrote in message news:E0D47212-DCFE-4C47-84AB-708C4838E81E@microsoft.com... >I have a column which is title, Expected Completition Date. Therefore > multiple da...

how to determine schemas for validation
I am trying to validate document parts of Office 2007 documents. The method I have tried using is to sort through each XML file to see which namespaces are used, load the corresponding schemas for those namespaces, then try to validate the document against that schema set. When it gets to more complicated documents, for example a Word document utilizing many features, several open office XML schemas might be used. When I try to load them all into a XmlSchemaSet, it won't compile because certain elements will have been declared more than once. For example, if I load the following schemas ...

Vista UAC/Privilege determination
I have two intercommunicating processes. Process A sets a hook into process B (for purposes I can't talk about due to NDA issues). The problem I'm having is this: if I run A as an ordinary user, it can't set a hook in B if I run A as administrator, it can hook B, but when the hook runs in B, it can't PostMessage back to A. It appears that I have a situation where if A is an administrator, then B is running at a privilege level lower than A but higher than an ordinary user. So while I can hook it, I can't have it send back to me. But running as a limited user, I can&#...

determine what program is used to view html link in outlook message
where do I set up the program that will be used to view links in html outlook messages? Last I knew Outlook used the default browser on your system. "Allan J. Behr" <al@thebehrs.net> wrote in message news:FF55A15C-F12A-4646-9775-EAE0091D8A33@microsoft.com... > where do I set up the program that will be used to view links in html > outlook messages? ...

enabling and desabling autofiler on protect sheet
Hi all, how can i give the option in the VBA command to dynamicly enable or desable autofilter on a row when the cells are protected for any editing ...

Help me determine what I whould buy.
I'm a DB programmer running Windows ME on my home system, while all my customers are running Windows XP. I want to be able to take screen shots of forms that I create. Latter I may want to produce DB diagrams, but that's not important now. If I need to upgrade my system to XP, I will. What version of Visio should I buy? I know how simple this is to someone knowing this product, but I'm not there yet, sorry. You need Visio Professional edition for Software and Database functionality. The latest version is Visio 2003, which only runs on Windows 2000 or Windows XP. If you de...