# lv_windows_context.h (/api/drivers/windows/lv_windows_context_h)



<ApiSummary functions="2" structs="6" typedefs="6" macros="2" />

Functions [#functions]

<ApiTabs items="[&#x22;Getters (1)&#x22;,&#x22;Other (1)&#x22;]">
  <ApiTab value="Getters (1)">
    <ApiMember kind="function" name="lv_windows_get_window_context" file="drivers/windows/lv_windows_context.h" line="121" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/windows/lv_windows_context.h#L121">
      lv_windows_get_window_context [#lv_windows_get_window_context]

      Get the window context from specific LVGL display window.

      ```c title=" " lineNumbers=1
      lv_windows_window_context_t * lv_windows_get_window_context(HWND window_handle)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name            | Type   | Description                                        |
      | --------------- | ------ | -------------------------------------------------- |
      | `window_handle` | `HWND` | The window handle of specific LVGL display window. |

      **Returns:** <ApiLink name="lv_windows_window_context_t" display="lv_windows_window_context_t *" /> — The window context from specific LVGL display window.

      <Callout type="info">
        **Remark:** This is a private API which is used for LVGL Windows backend implementation. LVGL users shouldn't use that because the maintainer doesn't promise the application binary interface compatibility for this API.
      </Callout>
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (1)">
    <ApiMember kind="function" name="lv_windows_platform_init" file="drivers/windows/lv_windows_context.h" line="110" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/windows/lv_windows_context.h#L110">
      lv_windows_platform_init [#lv_windows_platform_init]

      Initialize the LVGL Windows backend.

      ```c title=" " lineNumbers=1
      void lv_windows_platform_init(void)
      ```

      <Callout type="info">
        **Remark:** This is a private API which is used for LVGL Windows backend implementation. LVGL users shouldn't use that because the LVGL has already used it in lv\_init.
      </Callout>
    </ApiMember>
  </ApiTab>
</ApiTabs>

Structs [#structs]

<ApiMember kind="struct" name="_lv_windows_pointer_context_t">
  \_lv_windows_pointer_context_t [#_lv_windows_pointer_context_t]

  | Member  | Type                                                 | Description |
  | ------- | ---------------------------------------------------- | ----------- |
  | `state` | <ApiLink name="lv_indev_state_t" />                  |             |
  | `point` | <ApiLink name="lv_point_t" />                        |             |
  | `indev` | <ApiLink name="lv_indev_t" display="lv_indev_t *" /> |             |
</ApiMember>

<ApiMember kind="struct" name="_lv_windows_keypad_queue_item_t">
  \_lv_windows_keypad_queue_item_t [#_lv_windows_keypad_queue_item_t]

  | Member  | Type                                | Description |
  | ------- | ----------------------------------- | ----------- |
  | `key`   | <ApiLink name="uint32_t" />         |             |
  | `state` | <ApiLink name="lv_indev_state_t" /> |             |
</ApiMember>

<ApiMember kind="struct" name="_lv_windows_keypad_context_t">
  \_lv_windows_keypad_context_t [#_lv_windows_keypad_context_t]

  | Member                 | Type                                                 | Description |
  | ---------------------- | ---------------------------------------------------- | ----------- |
  | `queue`                | <ApiLink name="lv_ll_t" />                           |             |
  | `utf16_high_surrogate` | <ApiLink name="uint16_t" />                          |             |
  | `utf16_low_surrogate`  | <ApiLink name="uint16_t" />                          |             |
  | `indev`                | <ApiLink name="lv_indev_t" display="lv_indev_t *" /> |             |
</ApiMember>

<ApiMember kind="struct" name="_lv_windows_encoder_context_t">
  \_lv_windows_encoder_context_t [#_lv_windows_encoder_context_t]

  | Member     | Type                                                 | Description |
  | ---------- | ---------------------------------------------------- | ----------- |
  | `state`    | <ApiLink name="lv_indev_state_t" />                  |             |
  | `enc_diff` | <ApiLink name="int16_t" />                           |             |
  | `indev`    | <ApiLink name="lv_indev_t" display="lv_indev_t *" /> |             |
</ApiMember>

<ApiMember kind="struct" name="_lv_windows_window_context_t">
  \_lv_windows_window_context_t [#_lv_windows_window_context_t]

  | Member                               | Type                                                     | Description |
  | ------------------------------------ | -------------------------------------------------------- | ----------- |
  | `display_device_object`              | <ApiLink name="lv_display_t" display="lv_display_t *" /> |             |
  | `display_timer_object`               | <ApiLink name="lv_timer_t" display="lv_timer_t *" />     |             |
  | `window_dpi`                         | <ApiLink name="int32_t" />                               |             |
  | `zoom_level`                         | <ApiLink name="int32_t" />                               |             |
  | `allow_dpi_override`                 | <ApiLink name="bool" />                                  |             |
  | `simulator_mode`                     | <ApiLink name="bool" />                                  |             |
  | `display_resolution_changed`         | <ApiLink name="bool" />                                  |             |
  | `requested_display_resolution`       | <ApiLink name="lv_point_t" />                            |             |
  | `display_framebuffer_context_handle` | `HDC`                                                    |             |
  | `display_framebuffer_base`           | <ApiLink name="uint32_t" display="uint32_t *" />         |             |
  | `display_framebuffer_size`           | <ApiLink name="size_t" />                                |             |
  | `pointer`                            | <ApiLink name="lv_windows_pointer_context_t" />          |             |
  | `keypad`                             | <ApiLink name="lv_windows_keypad_context_t" />           |             |
  | `encoder`                            | <ApiLink name="lv_windows_encoder_context_t" />          |             |
</ApiMember>

<ApiMember kind="struct" name="_lv_windows_create_display_data_t">
  \_lv_windows_create_display_data_t [#_lv_windows_create_display_data_t]

  | Member               | Type                                                     | Description |
  | -------------------- | -------------------------------------------------------- | ----------- |
  | `title`              | `const wchar_t *`                                        |             |
  | `hor_res`            | <ApiLink name="int32_t" />                               |             |
  | `ver_res`            | <ApiLink name="int32_t" />                               |             |
  | `zoom_level`         | <ApiLink name="int32_t" />                               |             |
  | `allow_dpi_override` | <ApiLink name="bool" />                                  |             |
  | `simulator_mode`     | <ApiLink name="bool" />                                  |             |
  | `mutex`              | `HANDLE`                                                 |             |
  | `display`            | <ApiLink name="lv_display_t" display="lv_display_t *" /> |             |
</ApiMember>

Typedefs [#typedefs]

<ApiMember kind="typedef" name="lv_windows_pointer_context_t" file="drivers/windows/lv_windows_context.h" line="48" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/windows/lv_windows_context.h#L48">
  lv_windows_pointer_context_t [#lv_windows_pointer_context_t]

  ```c title=" " lineNumbers=1
  typedef struct _lv_windows_pointer_context_t lv_windows_pointer_context_t
  ```
</ApiMember>

<ApiMember kind="typedef" name="lv_windows_keypad_queue_item_t" file="drivers/windows/lv_windows_context.h" line="53" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/windows/lv_windows_context.h#L53">
  lv_windows_keypad_queue_item_t [#lv_windows_keypad_queue_item_t]

  ```c title=" " lineNumbers=1
  typedef struct _lv_windows_keypad_queue_item_t lv_windows_keypad_queue_item_t
  ```
</ApiMember>

<ApiMember kind="typedef" name="lv_windows_keypad_context_t" file="drivers/windows/lv_windows_context.h" line="60" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/windows/lv_windows_context.h#L60">
  lv_windows_keypad_context_t [#lv_windows_keypad_context_t]

  ```c title=" " lineNumbers=1
  typedef struct _lv_windows_keypad_context_t lv_windows_keypad_context_t
  ```
</ApiMember>

<ApiMember kind="typedef" name="lv_windows_encoder_context_t" file="drivers/windows/lv_windows_context.h" line="66" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/windows/lv_windows_context.h#L66">
  lv_windows_encoder_context_t [#lv_windows_encoder_context_t]

  ```c title=" " lineNumbers=1
  typedef struct _lv_windows_encoder_context_t lv_windows_encoder_context_t
  ```
</ApiMember>

<ApiMember kind="typedef" name="lv_windows_window_context_t" file="drivers/windows/lv_windows_context.h" line="87" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/windows/lv_windows_context.h#L87">
  lv_windows_window_context_t [#lv_windows_window_context_t]

  ```c title=" " lineNumbers=1
  typedef struct _lv_windows_window_context_t lv_windows_window_context_t
  ```
</ApiMember>

<ApiMember kind="typedef" name="lv_windows_create_display_data_t" file="drivers/windows/lv_windows_context.h" line="98" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/windows/lv_windows_context.h#L98">
  lv_windows_create_display_data_t [#lv_windows_create_display_data_t]

  ```c title=" " lineNumbers=1
  typedef struct _lv_windows_create_display_data_t lv_windows_create_display_data_t
  ```
</ApiMember>

Macros [#macros]

<ApiMember kind="macro" name="CREATE_WAITABLE_TIMER_MANUAL_RESET" file="drivers/windows/lv_windows_context.h" line="29" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/windows/lv_windows_context.h#L29">
  CREATE_WAITABLE_TIMER_MANUAL_RESET [#create_waitable_timer_manual_reset]

  ```c title=" " lineNumbers=1
  #define CREATE_WAITABLE_TIMER_MANUAL_RESET 0x00000001
  ```
</ApiMember>

<ApiMember kind="macro" name="CREATE_WAITABLE_TIMER_HIGH_RESOLUTION" file="drivers/windows/lv_windows_context.h" line="33" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/windows/lv_windows_context.h#L33">
  CREATE_WAITABLE_TIMER_HIGH_RESOLUTION [#create_waitable_timer_high_resolution]

  ```c title=" " lineNumbers=1
  #define CREATE_WAITABLE_TIMER_HIGH_RESOLUTION 0x00000002
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_display.h&#x22;, &#x22;lv_indev.h&#x22;, &#x22;windows.h&#x22;]" transitiveIncludes="[&#x22;lv_area.h&#x22;, &#x22;lv_array.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_internal.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_group.h&#x22;, &#x22;lv_ll.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
