A Windows Vista forum. Vista Banter

Welcome to Vista Banter.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to ask questions and reply to others posts, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

Go Back   Home » Vista Banter forum » Microsoft Windows Vista » Hardware and Windows Vista
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Hardware and Windows Vista Hardware issues in relation to Windows Vista. (microsoft.public.windows.vista.hardware_devices)

Power Management in Windows Vista



 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old August 1st 08, 03:33 PM posted to microsoft.public.windows.vista.hardware_devices
Vikram
external usenet poster
 
Posts: 5
Default Power Management in Windows Vista

Hi,

I want to develop an application for Windows Vista, which would detect Power
button Press and stop the machine from shutting down or restarting or going
into suspend mode.

After investigation we found that when the machine is shutdown or restarted
"WM_QUERYENDSESSION" message is sent to every process. However to trap this
message we had to use SetProcessShutdownParameters with 3FF as the dwLevel.
To stop the machine from shutting down I returned false when this message
was detected, a dialog box asking the user whether to shutdown or not is
prompted. Is there some way wherein this dailog box can be avoided and the
shutdown process is directly cancelled.

In case of Hibernate and Suspend we learned that wParam is returned as
"PBT_APMQUERYSUSPEND" and "PBT_APMSUSPEND" . But even after using a trap
handler for this we could not trap the event in Windows Vista. I am using
SetThreadExecutionState() API with ES_CONTINUOUS parameters when
"PBT_APMQUERYSUSPEND" and "PBT_APMSUSPEND" message is traped in WndProc()
function for preventing the system from Hibernate and Suspend mode to go.
Can you please let us know how to trap the Hibernate and Suspend event and
mask the Hibernate and Suspend mode?

Regards,
Vikram
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:02 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Optimization by vBSEO 3.0.0 RC6
Copyright ©2004-2024 Vista Banter.
The comments are property of their posters.