# What Are ImGuiWindowFlags and How to Use Them in Dear ImGui

> Master ImGuiWindowFlags in Dear ImGui to control window behavior. Learn how to use these bit-field constants with ImGui::Begin() for custom UI elements.

- Repository: [omar/imgui](https://github.com/ocornut/imgui)
- Tags: deep-dive
- Published: 2026-07-27

---

**ImGuiWindowFlags are bit-field constants defined in [`imgui.h`](https://github.com/ocornut/imgui/blob/main/imgui.h) that control the appearance, sizing, and interaction model of ImGui windows, which you combine with the bitwise OR operator (`|`) and pass to `ImGui::Begin()` or `ImGui::BeginChild()`.**

In the `ocornut/imgui` repository, **ImGuiWindowFlags** provide the primary mechanism for customizing how a window behaves when created with `ImGui::Begin()`. These flags let you remove title bars, disable resizing, enable auto-fit, and fine-tune navigation without subclassing or overriding rendering code.

## Where ImGuiWindowFlags Are Defined

In [`imgui.h`](https://github.com/ocornut/imgui/blob/main/imgui.h) (around line 1171), Dear ImGui declares the `ImGuiWindowFlags_` enum and exposes it through the `ImGuiWindowFlags` type. Each constant is defined as a single bit shift (`1 << n`), so multiple flags can be merged into one bitmask without overlap.

## Common ImGuiWindowFlags Values

The public API exposes a broad set of window-level toggles. The most frequently used **ImGuiWindowFlags** include:

- **ImGuiWindowFlags_NoTitleBar** — Hides the title bar; useful for borderless pop-up panels.
- **ImGuiWindowFlags_NoResize** — Removes resize grips and prevents manual resizing.
- **ImGuiWindowFlags_NoMove** — Locks the window in place, which is ideal for HUD elements.
- **ImGuiWindowFlags_NoScrollbar** — Hides scrollbars while still allowing programmatic scrolling.
- **ImGuiWindowFlags_NoCollapse** — Removes the collapse button from the title bar.
- **ImGuiWindowFlags_AlwaysAutoResize** — Forces the window to fit its contents every single frame.
- **ImGuiWindowFlags_MenuBar** — Allocates extra space for a menu bar via `ImGui::BeginMenuBar()`.
- **ImGuiWindowFlags_NoBackground** — Skips background drawing, producing a transparent overlay effect.
- **ImGuiWindowFlags_NoFocusOnAppearing** — Prevents the window from stealing focus when it is first shown.
- **ImGuiWindowFlags_NoBringToFrontOnFocus** — Keeps the window at its current Z-order even when focused.
- **ImGuiWindowFlags_HorizontalScrollbar** — Adds a horizontal scrollbar for wide content.
- **ImGuiWindowFlags_NoNav** — Disables keyboard and gamepad navigation entirely inside the window.

## How to Combine and Apply ImGuiWindowFlags

You pass the combined bitmask as the third argument of `ImGui::Begin()` or via the optional `window_flags` parameter of `ImGui::BeginChild()`. To request default behavior, pass `0` or `ImGuiWindowFlags_None`.

### Fixed-Size Tool Window Example

```cpp
ImGui::Begin("Fixed", nullptr,
             ImGuiWindowFlags_NoTitleBar |
             ImGuiWindowFlags_NoResize |
             ImGuiWindowFlags_NoScrollbar);
ImGui::Text("This window cannot be moved, resized or scrolled.");
ImGui::End();

```

### Auto-Resizing Debug Panel Example

```cpp
ImGui::Begin("Auto-Resize", nullptr,
             ImGuiWindowFlags_AlwaysAutoResize |
             ImGuiWindowFlags_NoCollapse);
for (int i = 0; i < 10; ++i)
    ImGui::Text("Line %d", i);
ImGui::End();

```

### Child Window with Flags Example

```cpp
ImGui::Begin("Parent");
ImGui::BeginChild("Child", ImVec2(0, ImGui::GetContentRegionAvail().y),
                   ImGuiChildFlags_Borders |
                   ImGuiChildFlags_AutoResizeX);
ImGui::Text("Child window expands horizontally.");
ImGui::EndChild();
ImGui::End();

```

## Internal Flags to Avoid

Dear ImGui reserves several flags for its own window management logic in [`imgui.cpp`](https://github.com/ocornut/imgui/blob/main/imgui.cpp). These include `ImGuiWindowFlags_ChildWindow`, `ImGuiWindowFlags_Tooltip`, and `ImGuiWindowFlags_Popup`. Because they drive internal behavior and are not part of the public API, application code should never set them manually; doing so can create silent bugs or break compatibility with future releases.

## Key Source Files

- **[`imgui.h`](https://github.com/ocornut/imgui/blob/main/imgui.h)** — Declares the `ImGuiWindowFlags_` enum and the `ImGui::Begin()` / `ImGui::BeginChild()` signatures that accept the flags.
- **[`imgui.cpp`](https://github.com/ocornut/imgui/blob/main/imgui.cpp)** — Contains the core implementation that interprets the bitmask and applies the corresponding drawing and interaction rules.
- **[`imgui_demo.cpp`](https://github.com/ocornut/imgui/blob/main/imgui_demo.cpp)** — Provides runnable demonstrations; search for `Begin(` to see how different flag combinations behave in practice.

## Summary

- **ImGuiWindowFlags** are bit-field constants stored in the `ImGuiWindowFlags` type, declared in [`imgui.h`](https://github.com/ocornut/imgui/blob/main/imgui.h).
- Combine multiple flags with the bitwise OR operator (`|`) and pass the result to `ImGui::Begin()` or `ImGui::BeginChild()`.
- Use `0` or `ImGuiWindowFlags_None` when you want the default window chrome and behavior.
- Avoid internal flags such as `ImGuiWindowFlags_ChildWindow` because they are reserved for internal use inside [`imgui.cpp`](https://github.com/ocornut/imgui/blob/main/imgui.cpp).

## Frequently Asked Questions

### How do I combine multiple ImGuiWindowFlags?

Combine individual constants with the bitwise OR operator (`|`). Because each value occupies a unique bit, OR-ing them produces a safe bitmask that `ImGui::Begin()` interprets correctly.

### Can I use ImGuiWindowFlags with ImGui::BeginChild()?

Yes. `ImGui::BeginChild()` accepts an optional `ImGuiWindowFlags` parameter, so child windows can be configured with the same window-level flags as top-level windows.

### What happens if I pass 0 or ImGuiWindowFlags_None?

Passing zero or the explicit `ImGuiWindowFlags_None` constant yields the default window behavior, including a title bar, resize grips, scrollbars, and collapse button.

### Are internal flags such as ImGuiWindowFlags_ChildWindow safe to use?

No. Flags like `ImGuiWindowFlags_ChildWindow`, `ImGuiWindowFlags_Tooltip`, and `ImGuiWindowFlags_Popup` are reserved for Dear ImGui's internal implementation. Using them in your application code is unsupported and may break in future versions.