REASON_CONTEXT structure

Contains information about a power request. This structure is used by the PowerCreateRequest and SetWaitableTimerEx functions.

Syntax

typedef struct _REASON_CONTEXT {
  ULONG Version;
  DWORD Flags;
  union {
    struct {
      HMODULE LocalizedReasonModule;
      ULONG   LocalizedReasonId;
      ULONG   ReasonStringCount;
      LPWSTR  *ReasonStrings;
    } Detailed;
    LPWSTR SimpleReasonString;
  } Reason;
} REASON_CONTEXT, *PREASON_CONTEXT;

Members

Version

The version number of the structure. This parameter must be set to POWER_REQUEST_CONTEXT_VERSION.

Flags

The format of the reason for the power request. This parameter can be one of the following values:

Value Meaning
POWER_REQUEST_CONTEXT_DETAILED_STRING
0x00000002
The Detailed structure identifies a localizable string resource that describes the reason for the power request.
POWER_REQUEST_CONTEXT_SIMPLE_STRING
0x00000001
The SimpleReasonString parameter contains a simple, non-localizable string that describes the reason for the power request.

Reason

A union that consists of either a Detailed structure or a string.

Reason.Detailed

Reason.Detailed.LocalizedReasonModule

The module that contains the string resource.

Reason.Detailed.LocalizedReasonId

The ID of the string resource.

Reason.Detailed.ReasonStringCount

The number of strings in the ReasonStrings parameter.

Reason.Detailed.ReasonStrings

An array of strings to be substituted in the string resource at run time.

Reason.SimpleReasonString

A non-localized string that describes the reason for the power request.

Requirements

   
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Header minwinbase.h (include Windows.h)

See Also

PowerCreateRequest

SetWaitableTimerEx