1# @ohos.app.ability.StartOptions (StartOptions) (System API) 2 3**StartOptions** is used as an input parameter of [startAbility()](js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartability-1) to specify the window mode of an ability. 4 5> **NOTE** 6> 7> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8> 9> The APIs of this module can be used only in the stage model. 10> 11> This topic describes only system APIs provided by the module. For details about its public APIs, see [@ohos.app.ability.StartOptions (StartOptions)](js-apis-app-ability-startOptions.md). 12 13## Modules to Import 14 15```ts 16import { StartOptions } from '@kit.AbilityKit'; 17``` 18 19## Properties 20 21**System capability**: SystemCapability.Ability.AbilityRuntime.Core 22 23| Name| Type| Read-only| Optional| Description| 24| -------- | -------- | -------- | -------- | -------- | 25| [windowMode](js-apis-app-ability-abilityConstant-sys.md#windowmode) | number | No| Yes| Window mode.<br>**System API**: This is a system API and cannot be called by third-party applications.| 26| windowFocused<sup>12+</sup> | boolean | No| Yes| Whether the window has focus. The default value is **true**, indicating that the window has focus.<br>**Constraints**:<br>This property takes effect only on tablets and 2-in-1 devices.<br>This property takes effect only in [UIAbilityContext.startAbility](js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartability-1).| 27 28**Example** 29 30 ```ts 31 import { UIAbility, Want, StartOptions } from '@kit.AbilityKit'; 32 import { BusinessError } from '@kit.BasicServicesKit'; 33 34 export default class EntryAbility extends UIAbility { 35 36 onForeground() { 37 let want: Want = { 38 deviceId: '', 39 bundleName: 'com.example.myapplication', 40 abilityName: 'EntryAbility' 41 }; 42 let options: StartOptions = { 43 displayId: 0 44 }; 45 46 try { 47 this.context.startAbility(want, options, (err: BusinessError) => { 48 if (err.code) { 49 // Process service logic errors. 50 console.error(`startAbility failed, code is ${err.code}, message is ${err.message}`); 51 return; 52 } 53 // Carry out normal service processing. 54 console.info('startAbility succeed'); 55 }); 56 } catch (err) { 57 // Process input parameter errors. 58 let code = (err as BusinessError).code; 59 let message = (err as BusinessError).message; 60 console.error(`startAbility failed, code is ${code}, message is ${message}`); 61 } 62 } 63 } 64 ``` 65