by Lynn Merrill. Intel Corp.
Does this sound familiar? You're working on an application with critical data ready for submission or publication, and suddenly you need to step away for an urgent matter that takes longer than expected. You return to your desk only to find that the computer has gone into a suspended state, or has even shut down completely. You might have lost some or all of your critical data, simply because the application did not "save" before being halted in its execution. Do you know anyone who hasn't had an experience like this? Application developers can help us avoid this scenario by paying attention to the messages and events that are sent by the operating system prior to the suspension or hibernation of the system
This paper provides examples of what happens when a system prepares to suspend operations, suspends operations, and resumes operations from a suspended state, within a Windows environment. We address the purpose of the messages and events that are sent and describe their proper use and timing while offering suggestions for how to use them efficiently to avoid possible data loss. In addition, we explore what types of applications should be paying attention to these messages and events. Focusing on the messaging specific to the Windows XP Professional operating systems, coding examples are provided to illustrate ways to prepare for and recover from the suspension and to suggest ways to either prevent suspension from occurring, or to work around the current limitations. A basic understanding of Windows messaging is assumed for this discussion.
Definitions
| WM_POWERBROADCAST – | Message broadcast to the application through the WindowProc() function indicating that a power-management event has or is occurring. |
| PBT_APMQUERYSUSPEND – | Event that requests permission to suspend |
| PBT_APMQUERYSUSPENDFAILED – | Event that informs of a failed request to suspend |
| PBT_APMRESUMEAUTOMATIC – | Event received on automatic resume from suspended state |
| PBT_APMRESUMECRITICAL – | Event that signals resume from an unknown and volatile state |
| PBT_APMRESUMESUSPEND – | Event that signals a resume from a suspend |
| PBT_APMSUSPEND – | Event received just prior to system suspending |
Motivation
Developing applications can be tricky business. With the advent of the mobile environment, that business became even trickier. Deciding which applications need to pay attention to the suspension of the computer, and which ones need not, is the first step. To begin, any application that would be effected by a change in operating environment, such as network, USB, or Firewire connections, those that cannot be interrupted before they complete their operation or any application that displays information on the monitor without user interaction are all applications that should be suspension aware.
![]()
If you're interested in this topic, these articles may be helpful:
![]() | From here to there: software architecture for mobile computing by Chris S. Thomas, chief strategist, Intel Corp. Last month I wrot... |
![]() | Intel optimization best practices: no magic, just discipline and good tools by Andrew Binstock, principal analyst, Pacific Data Works LLC. Intel C... |
![]() | Guidance for securing Microsoft Windows XP systems for IT professionals from National Institute of Standards and Technology Guidance for se... |
![]() | Beyond Software Architecture: Creating and Sustaining Winning Solutions, Chapter 8 - Integration and Extension by Luke Hohmann. Publisher: Addison-Wesley and Prentice Hall. As de... |
![]() | Implementing mobile security by Jim Geier, principal, Wireless-Nets Ltd. Intel Corp. Learn t... |
![]()
Related Jobs:
![]() | Software Development Engineer #148124 - WA - Redmond - Microsoft Corporation Microsoft’s Tablet PC: The evolution of the notebook PC Work on the... |
![]() | PC Systems Admin, II #5563 - CA - Mountain View - Synopsys, Inc. US01-Mountain View - PC Systems Support -------------------------... |
![]() | Engineer, RF #71722 - CA - Irvine - T-Mobile USA, Inc. Job Details Requisition #: 71722 Position Title: Engineer, RF (Irvin... |
![]() | Engineer, RF (Las Vegas) #74204 - NV - Las Vegas - T-Mobile USA, Inc. Job Details Requisition #: 74204 Position Title: Engineer, RF (Las V... |
![]() | Field Application Engineer #236 - TX - Austin - Synaptics Field Application Engineer Location: Austin, Texas Department: Sales... |
![]() | Engineer, RF #74243 - CA - Irvine - T-Mobile USA, Inc. Job Details Requisition #: 74243 Position Title: Engineer, RF Locat... |
![]() | Engineer, RF #71725 - CA - Irvine - T-Mobile USA, Inc. Job Details Requisition #: 71725 Position Title: Engineer, RF (Irvin... |
![]() | Senior Firmware Engineer #S05-4608 - WA - Spokane - General Dynamics C4 Systems Job Title Senior Firmware Engineer - Spokane, WA Location Spokane WA... |
![]() | Engineer, RF #71724 - CA - Irvine - T-Mobile USA, Inc. Job Details Requisition #: 71724 Position Title: Engineer, RF (Irvin... |
![]() | Engineer, RF #104659 - OK - Oklahoma City - T-Mobile USA, Inc. Job Details Requisition #: 104659 Position Title: Engineer, RF Loca... |

