Main window focused question

Version/Branch of Dear ImGui:
Version: 1.69
Branch: docking

Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_opengl2.cpp + imgui_impl_glfw.cpp
Compiler: Visual Studio 2017
Operating System: Win10

My Issue/Question:
Hello omar.

I want to know if the main window is focus.
(not ImGui::IsAnyWindowFocused(), IsRootWindowFocused or etc…)
(focus between imgui program / other program / window background…)

In fact, this question may not be the question of the imgui itself, so it is very hesitant…
maybe there are external ways to solve this problem.
but i want know If the functions of the imgui itself that I did not know are already supporting,
I would appreciate it if you could let me know what they are.

Thank you always.

p.s
What are the criteria for what is being addressed in Imgui?
I am worried when I talk about a function or topic that binds to glfw things…

If you are talking about the OS window, you can probably use GetActiveWindow() with is a Win32 API function:

Compare the result of GetActiveWindow with the HWND value you want to test for.

In this situation, this is now really a dear imgui question.
Don’t worry about it.

1 Like