Window State and Constraints

Window State

Minimize the Window

Sends the window to the taskbar.

C
int32_t minimize_window(uint32_t window_id);

Parameters:

  • window_id uint32_t - Target window id

Toggle the Maximized State

Toggles between maximized and restored.

C
int32_t toggle_maximize_window(uint32_t window_id);

Parameters:

  • window_id uint32_t - Target window id

Query Whether Maximized

Queries whether the window is currently maximized.

C
int32_t is_window_maximized(uint32_t window_id);

Parameters:

  • window_id uint32_t - Target window id

Return value:

  • 1 - Currently maximized
  • 0 - Currently not maximized

Set Fullscreen

Enters or exits fullscreen (filling the monitor, not just maximizing). The request takes effect asynchronously; you can also listen for the window-fullscreen event.

C
int32_t set_window_fullscreen(uint32_t window_id, int32_t fullscreen);

Parameters:

  • window_id uint32_t - Target window id
  • fullscreen int32_t - Non-0 enters fullscreen, 0 exits fullscreen

Query Whether the Window Is Minimized (is_window_minimized)

C
int32_t is_window_minimized(uint32_t window_id);
  • Parameters: window_id uint32_t
  • Return value: 1 = minimized, 0 = not

Query Whether the Window Is Visible (is_window_visible)

C
int32_t is_window_visible(uint32_t window_id);
  • Parameters: window_id uint32_t
  • Return value: 1 = visible, 0 = not visible

Query Whether the Window Is Focused (is_window_focused)

C
int32_t is_window_focused(uint32_t window_id);
  • Parameters: window_id uint32_t
  • Return value: 1 = focused, 0 = not

Query Whether the Window Is Fullscreen (is_window_fullscreen)

C
int32_t is_window_fullscreen(uint32_t window_id);
  • Parameters: window_id uint32_t
  • Return value: 1 = fullscreen, 0 = not

Window Constraints

Set the Window Minimum Size (set_window_min_size)

C
int32_t set_window_min_size(uint32_t window_id, int32_t width, int32_t height);
  • Parameters: window_id, width (minimum width), height (minimum height)
  • Return value: 1 = success, 0 = failure

Set the Window Maximum Size (set_window_max_size)

C
int32_t set_window_max_size(uint32_t window_id, int32_t width, int32_t height);
  • Parameters: window_id, width (maximum width), height (maximum height)
  • Return value: 1 = success, 0 = failure

Set Whether the Window Is Resizable (set_window_resizable)

C
int32_t set_window_resizable(uint32_t window_id, int32_t resizable);
  • Parameters: window_id, resizable (1 = resizable, 0 = not)
  • Return value: 1 = success, 0 = failure

Enable or Disable the Window

When a window is disabled, the user cannot click the controls on it (like the grayed-out window behind a modal dialog); pass non-0 to restore it.

C
int32_t set_window_enabled(uint32_t window_id, int32_t enabled);

Parameters:

  • window_id uint32_t - Target window id
  • enabled int32_t - Non-0 enables, 0 disables