• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# oh_window.h
2
3
4## Overview
5
6The **oh_window.h** file declares the window management APIs. You can use the APIs to set and obtain the properties of a window, and set its status bar style and navigation bar style.
7
8**File to include**: <window_manager/oh_window.h>
9
10**System capability**: SystemCapability.Window.SessionManager
11
12**Library**: libnative_window_manager.so
13
14**Since**: 15
15
16**Related module**: [WindowManager_NativeModule](_window_manager___native_module.md)
17
18
19## Summary
20
21
22### Functions
23
24| Name| Description|
25| -------- | -------- |
26| int32_t [OH_WindowManager_SetWindowStatusBarEnabled](_window_manager___native_module.md#oh_windowmanager_setwindowstatusbarenabled) (int32_t windowId, bool enabled, bool enableAnimation) | Sets whether to display the status bar in a window.|
27| int32_t [OH_WindowManager_SetWindowStatusBarColor](_window_manager___native_module.md#oh_windowmanager_setwindowstatusbarcolor) (int32_t windowId, int32_t color) | Sets the color of the status bar in a window.|
28| int32_t [OH_WindowManager_SetWindowNavigationBarEnabled](_window_manager___native_module.md#oh_windowmanager_setwindownavigationbarenabled) (int32_t windowId, bool enabled, bool enableAnimation) | Sets whether to display the navigation bar in a window.|
29| int32_t [OH_WindowManager_GetWindowAvoidArea](_window_manager___native_module.md#oh_windowmanager_getwindowavoidarea) (int32_t windowId, [WindowManager_AvoidAreaType](_window_manager___native_module.md#windowmanager_avoidareatype) type, [WindowManager_AvoidArea](_window_manager___avoid_area.md) \*avoidArea) | Obtains the avoid area of a window.|
30| [WindowManager_ErrorCode](_window_manager___native_module.md#windowmanager_errorcode) [OH_WindowManager_IsWindowShown](_window_manager___native_module.md#oh_windowmanager_iswindowshown) (int32_t windowId, bool \*isShow) | Checks whether a window is displayed.|
31| [WindowManager_ErrorCode](_window_manager___native_module.md#windowmanager_errorcode) [OH_WindowManager_ShowWindow](_window_manager___native_module.md#oh_windowmanager_showwindow) (int32_t windowId) | Displays a window.|
32| int32_t [OH_WindowManager_SetWindowTouchable](_window_manager___native_module.md#oh_windowmanager_setwindowtouchable) (int32_t windowId, bool isTouchable) | Sets whether a window is touchable.|
33| int32_t [OH_WindowManager_SetWindowFocusable](_window_manager___native_module.md#oh_windowmanager_setwindowfocusable) (int32_t windowId, bool isFocusable) | Sets whether a window is focusable.|
34| int32_t [OH_WindowManager_SetWindowBackgroundColor](_window_manager___native_module.md#oh_windowmanager_setwindowbackgroundcolor) (int32_t windowId, const char \*color) | Sets the background color of a window.|
35| int32_t [OH_WindowManager_SetWindowBrightness](_window_manager___native_module.md#oh_windowmanager_setwindowbrightness) (int32_t windowId, float brightness) | Sets the screen brightness of a window.|
36| int32_t [OH_WindowManager_SetWindowKeepScreenOn](_window_manager___native_module.md#oh_windowmanager_setwindowkeepscreenon) (int32_t windowId, bool isKeepScreenOn) | Sets whether to always keep the screen on for a window.|
37| int32_t [OH_WindowManager_SetWindowPrivacyMode](_window_manager___native_module.md#oh_windowmanager_setwindowprivacymode) (int32_t windowId, bool isPrivacy) | Sets whether to enable privacy mode for a window. |
38| int32_t [OH_WindowManager_GetWindowProperties](_window_manager___native_module.md#oh_windowmanager_getwindowproperties) (int32_t windowId, [WindowManager_WindowProperties](_window_manager___window_properties.md) \*windowProperties) | Obtains the properties of a window.|
39| int32_t [OH_WindowManager_Snapshot](_window_manager___native_module.md#oh_windowmanager_snapshot) (int32_t windowId, OH_PixelmapNative \*pixelMap) | Obtains the snapshot of a window.|
40