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:

ValueMeaning
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.

Detailed

A structure that identifies a localizable string resource to describe the reason for the power request.

LocalizedReasonModule

The module that contains the string resource.

LocalizedReasonId

The ID of the string resource.

ReasonStringCount

The number of strings in the ReasonStrings parameter.

ReasonStrings

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

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);
WinBase.h on Windows 7 and Windows Server 2008 R2 (include Windows.h)

See also

PowerCreateRequest
SetWaitableTimerEx

 

 

Community Additions

ADD
Show:
© 2014 Microsoft