1# @ohos.app.ability.AbilityConstant (AbilityConstant) (System API)
2
3The **AbilityConstant** module defines the enums of the window types in the UIAbility.
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.AbilityConstant (AbilityConstant)](js-apis-app-ability-abilityConstant.md).
12
13## Modules to Import
14
15```ts
16import { AbilityConstant } from '@kit.AbilityKit';
17```
18
19## WindowMode
20
21Enumerates the window modes in which an ability can be displayed at startup. It can be used in **startAbility()** to specify the window mode when the ability is started.
22
23**System capability**: SystemCapability.Ability.AbilityRuntime.Core
24
25**System API**: This is a system API.
26
27| Name                       | Value| Description                |
28| ---                         | --- | ---                  |
29| WINDOW_MODE_UNDEFINED       | 0   | Undefined window mode.      |
30| WINDOW_MODE_FLOATING        | 102 | The ability is displayed in a floating window.|
31
32**Example**
33
34```ts
35import { UIAbility, StartOptions, Want, AbilityConstant } from '@kit.AbilityKit';
36import { BusinessError } from '@kit.BasicServicesKit';
37
38let want: Want = {
39  bundleName: 'com.example.myapplication',
40  abilityName: 'EntryAbility'
41};
42let option: StartOptions = {
43  windowMode: AbilityConstant.WindowMode.WINDOW_MODE_FULLSCREEN
44};
45
46// Ensure that the context is obtained.
47class MyAbility extends UIAbility {
48  onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) {
49    this.context.startAbility(want, option).then(() => {
50      console.log('Succeed to start ability.');
51    }).catch((error: BusinessError) => {
52      console.error('Failed to start ability with error: ${JSON.stringify(error)}');
53    });
54  }
55}
56```
57