Top.Mail.Ru
Мастера DELPHI, Delphi programming community Титульная страница Поиск, карта сайта Написать письмо 
| Новости | Поиск | FAQ | Статьи | Книги | Новости VCL |
| Форумы ЧАТ | Орешник | KOL и MCK |
Форумы -» Основная («Начинающим»)/ Базы / WinAPI / Компоненты / Сети / Media / Игры / Corba и COM / KOL / FreePascal / .Net / Прочее / RSDN.ORG

« предыдущая ветвь | форум | следующая ветвь »

Как отследить включение режима пониценного энергопотребеления?


andruxa ©   (2003-12-03 16:00:00) 

Поподробней пожалуйста.


me   (2003-12-03 16:33:00) [1]

MSDN, Platform SDK: Hardware
Using Power Management
To ensure that your application runs well, it must monitor power messages. The system initiates a sleep request by sending a PBT_APMQUERYSUSPEND event. Your application must respond to this request as follows:

1.If the application is not busy and does not have unsaved data on a network device, it must ensure that all outgoing operations are completed.
2.If the application has unsaved data on a network location, it must deny the sleep request by returning BROADCAST_QUERY_DENY and prepare to go to a sleep state.
3.If the application is busy, it must either return BROADCAST_QUERY_DENY or wait until the operation causing the busy status is finished, and then prepare to go to a sleep state.

After all applications have accepted the sleep request, the system sends a PBT_APMSUSPEND event. In response, your application must allow the hardware to completely power down by taking the following actions:

1.Save all data to local non-volatile storage. Write user data to temporary storage when the user has not requested that the original file be overwritten.
2.Closing all open files, including network files.
3.Pause sound.
4.Restore modified drivers to their original state

In some circumstances, the sleep request can be canceled. If this occurs, the system sends a PBT_APMQUERYSUSPENDFAILED event. In this case, the application should restore its data to a working state and continue operation.


Наверх

Титульная страница Поиск, карта сайта Написать письмо