
# 设置投屏对象
**接口描述**
该接口用于在开始投屏前设置主屏或扩展屏。
**注意事项**
调用开启投屏接口之前调用。
**接口定义**
```
/* 设置投屏对象 */   
int SetDisplayScreen(ShareAppScreenType screenChoice);
```
**参数描述**
| 参数           | 是否必须 | 类型                                                                                                     | 描述                                                                                                                                                   |
|:---|:---|:---|:---|
| screenChoice | 是    | [4.6.5.1.3](https://support.huaweicloud.com/ideahub-IdeaShare-SDK/win-sdk-0063.html)ShareAppScreenType | 设置时投主屏还是扩展屏 SCREEN_PRIMARY 0 主屏 默认值 SCREEN_SECONDARY 1 扩展屏 |
   
**返回值**
0 接口调用成功 非0 接口调用失败
**示例代码**
```
ShareServiceController* contorller = ShareServiceController::GetInstance();    
 if (contorller != NULL) {   
     contorller->SetDisplayScreen(this->chooseShareScreen);   
 }
```
