> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XFrontPanelSetLightStates

> XFrontPanelSetLightStates

# XFrontPanelSetLightStates

设置正面板指示灯的状态。

## 语法

```cpp theme={null}
HRESULT XFrontPanelSetLightStates(  
         XFrontPanelLight lights  
)  
```

### 参数

*lights*   \_In\_\
类型：[XFrontPanelLight](https://docs.xbox.com/zh-CN/reference/devkit/xfrontpaneldisplay/enums/xfrontpanellight.md)

指定正面板指示灯新状态的值。

### 返回值

类型：HRESULT

如果成功则返回 `S_OK`；否则返回错误代码。

## 注解

XBOX One X Dev Kit 的正面板包括与五个可编程按钮相对应的五个指示灯。

![XBOX One X 的正面板显示屏](https://mintcdn.com/microsoft-4404708b/-_0FrcE2bDxzGxv-/images/gdk/reference/front_panel_display_small.png?fit=max\&auto=format\&n=-_0FrcE2bDxzGxv-\&q=85\&s=8c81bf256714cec6526e83a4cbac5538)

对于 *lights* 参数，使用按位 OR 运算符组合 [XFrontPanelLight](https://docs.xbox.com/zh-CN/reference/devkit/xfrontpaneldisplay/enums/xfrontpanellight.md) 枚举中的值。

若要获取正面板指示灯的当前状态，请使用 [XFrontPanelGetLightStates](https://docs.xbox.com/zh-CN/reference/devkit/xfrontpaneldisplay/functions/xfrontpanelgetlightstates.md)。

有关详细信息，请参阅 [XBOX One X: Using the front panel display (NDA topic)](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/dev-kits/concepts/scorpio-frontpanel)。

## 要求

**头文件：** xfrontpaneldisplay.h

**库：** xfrontpaneldisplay.lib

**支持的平台：** XBOX One 系列主机和 XBOX Series 主机

## 另请参阅

[XFrontPanelDisplay](https://docs.xbox.com/zh-CN/reference/devkit/xfrontpaneldisplay/xfrontpaneldisplay_members.md)


## Related topics

- [XFrontPanelLight](https://docs.xbox.com/zh-CN/reference/devkit/xfrontpaneldisplay/enums/xfrontpanellight.md)
- [XFrontPanelGetLightStates](https://docs.xbox.com/zh-CN/reference/devkit/xfrontpaneldisplay/functions/xfrontpanelgetlightstates.md)
- [XFrontPanelDisplay（API 内容）](https://docs.xbox.com/zh-CN/reference/devkit/xfrontpaneldisplay/xfrontpaneldisplay_members.md)
- [XFrontPanelGetButtonStates](https://docs.xbox.com/zh-CN/reference/devkit/xfrontpaneldisplay/functions/xfrontpanelgetbuttonstates.md)
- [XFrontPanelButton](https://docs.xbox.com/zh-CN/reference/devkit/xfrontpaneldisplay/enums/xfrontpanelbutton.md)
