473,462 Members | 1,128 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to catch power-management messages in my c# app?

How can I catch Windows WM_POWERBROADCAST in my C# application to prevent
the PC from hibernating?
Thanks!
Nov 15 '05 #1
2 5340
Look @ Microsoft.Win32 namespace and you will find your anwser.

"Owen Woo" <wo*****@163.net> wrote in message
news:OE**************@tk2msftngp13.phx.gbl...
How can I catch Windows WM_POWERBROADCAST in my C# application to prevent
the PC from hibernating?
Thanks!

Nov 15 '05 #2
By Microsoft.Win32.PowerModeChangedEventHandler my application can only
receive suspending event. But how can I prevent from suspending?

"Questa.NET" <qu****@zonnet.nl> дÈëÏûÏ¢ÐÂÎÅ:c0**********@reader11.wxs.nl...
Look @ Microsoft.Win32 namespace and you will find your anwser.

"Owen Woo" <wo*****@163.net> wrote in message
news:OE**************@tk2msftngp13.phx.gbl...
How can I catch Windows WM_POWERBROADCAST in my C# application to prevent the PC from hibernating?
Thanks!


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Stephane Belzile | last post by:
Is there a way I can detect in vb.Net the power has switched to a UPS unit in case of power failure? Thanks
5
by: David | last post by:
I am having a bit of a problem with catching an exception within a thread. Here is the scenario: I have a Windows Form. I create a new thread. This new thread calls a method in another DLL...
9
by: Dmitriy Lapshin [C# / .NET MVP] | last post by:
Hi all, When a good developer should declare an exception variable in a catch clause? Consider an example: try { // Do something potentially dangerous... } catch(SomeException e)
9
by: Michael MacDonald | last post by:
Does someone have a good site I can visit or explain the use of Try" and Catch foe exception/error handling. What is the logic behind this command and maybe an example would be great!!!! Mike_Mac...
32
by: cj | last post by:
Another wish of mine. I wish there was a way in the Try Catch structure to say if there wasn't an error to do something. Like an else statement. Try Catch Else Finally. Also because I...
3
by: Tommaso Caldarola | last post by:
How to I catch task manager killing application event or accidentally switching off the computer?
3
by: greek | last post by:
the question is to calculate x^n(x power n) (whr n can be +ve or -ve) by using recursion. the algorithm is x= 1, n=0 1/x^n, n<0 x*x^(n-1), n>0 ...
7
by: Lloyd Sheen | last post by:
I noticed a thread a few days ago about the use of Try.. Catch versus testing variables etc and had in my mind to test exactly what the impact was. Its a mind boggler. I created a small windows...
2
by: =?Utf-8?B?VGFtbXkgTmVqYWRpYW4=?= | last post by:
Hi, I am trying to disable the power key in windows mobile version 6.0 while my application is running. The user should not be able to turn off or turn on the device. Those functionalities should...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.