Jump to content

ImGui in AutoIt - Advanced UI


Recommended Posts


  • ImGui is a popular library written by ocornut, it can make awesome user interface based on directx.
  • It is being used by many big apps/games
  • The UI is nice and flexible, easy to use because of frame-by-frame drawing.

So I decided to convert the entire ImGui library to AutoIt

  • At first it's just an experiment, i converted some basic draw functions of imgui, compile to a dll, then using DllCall in autoit to call the functions.
  • I was testing to see how much FPS i can get in autoit, and i was expected a low FPS, since autoit is slow.
  • Suprisingly, the FPS turned out to be so high, it works really fast, even when drawing 1000 buttons at the same time.


  • More than +270 functions converted from ImGui (compiled dll).
  • Has 90% of the capability of what you can do in C++;
  • Usable ImGuiIO and ImGuiStyle, so you can set whatever configurations you like.




#include <WinAPI.au3>
#include "ImGui.au3"

; Create a window
Local $hwnd = _ImGui_GUICreate("AutoIt ImGui", 1024, 768)

; Set style color
;~ _ImGui_StyleColorsDark()

Local $f_value = 5
While 1

    ; when the user click close button on the window, this will return false
    if Not _ImGui_PeekMsg() Then Exit

    ; must call

    _ImGui_Begin("Another window")
    _ImGui_Text("Hello there..")
    If _ImGui_Button("click me") Then $f_value = 5
    _ImGui_SliderFloat("slider", $f_value, 2, 20)
    If _ImGui_IsItemHovered() Then _ImGui_ToolTip("what r u doing?")
    ; must call



  • Most of the functions were converted automatically. I haven't tested all of them yet, if some function doesn't work for you, please tell me.
  • Still missing some features of ImGui, please tell me if you needed any.
  • Run \tools\imgui-au3-setup.au3 to add _ImGui functions to SciTE auto-complete.

Source Code

Edited by thedemons
Link to comment
Share on other sites

Link to comment
Share on other sites

I get the same, screenshots look great though. :P


Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples


Link to comment
Share on other sites

Tested it. Win 10 x64. No problems. Run in x86 and x64.

Q: What is the use of "FileInstall("imgui.dll", $__imgui_dllpath)". Why not just run from local folder.

;~ Local $__imgui_dllpath = @TempDir & "\temp-data-" & TimerInit() & ".tmp", $__imgui_created = False
;~ If Not FileInstall("imgui.dll", $__imgui_dllpath) Then
;~  MsgBox(16, "Error", "Cannot find imgui.dll")
;~  Exit
;~ EndIf

Global $__imgui_created = False
Global $__imgui_dllpath = @ScriptDir & "\imgui.dll"
If @AutoItX64 Then $__imgui_dllpath = @ScriptDir & "\dll_64\imgui.dll"

Global $IMGUI_DLL = DllOpen($__imgui_dllpath)

If $IMGUI_DLL = -1 Then
    MsgBox(16, "Error", "Cannot load imgui.dll" & @CRLF & "Please update to the latest version of DirectX")

Func Shutdown_()
    If $__imgui_created Then _ImGui_ShutDown()
;~  FileDelete($__imgui_dllpath)
... ...

Q: How can the _ImGui_GUICreate() be dock to the main GUI ?

Edited by argumentum

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.

Link to comment
Share on other sites

In the demo you've posted, the main gui, is not docked, nor dock-able. My question is if the docker can be planted first and the the main gui be docked in the docker.
And, thanks for sharing, this was a lot of work.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.

Link to comment
Share on other sites

This is an example docking space, please call MainDockSpace() after _ImGui_BeginFrame(), and remember to _ImGui_EnableDocking() first.

Func MainDockSpace($transparent_bg = True)

    Local $io = _ImGui_GetIO()
    if BitAND($io.ConfigFlags, $ImGuiConfigFlags_DockingEnable) = False Then Return False

    Local $opt_fullscreen_persistant = true
    Local $opt_fullscreen = $opt_fullscreen_persistant
    Local $dockspace_flags = $transparent_bg ? $ImGuiDockNodeFlags_PassthruCentralNode : $ImGuiDockNodeFlags_None

    Local $window_flags = $ImGuiWindowFlags_NoDocking

    $viewport = _ImGui_GetMainViewport()
    _ImGui_SetNextWindowPos($viewport.Pos_x, $viewport.Pos_y)
    _ImGui_SetNextWindowSize($viewport.Size_x, $viewport.Size_y)
    _ImGui_PushStyleVar($ImGuiStyleVar_WindowRounding, 0)
    _ImGui_PushStyleVar($ImGuiStyleVar_WindowBorderSize, 0)
    $window_flags = BitOR($window_flags, $ImGuiWindowFlags_NoTitleBar, $ImGuiWindowFlags_NoCollapse, $ImGuiWindowFlags_NoResize, $ImGuiWindowFlags_NoMove)
    $window_flags = BitOR($window_flags, $ImGuiWindowFlags_NoBringToFrontOnFocus, $ImGuiWindowFlags_NoNavFocus)

    if BitAND($dockspace_flags, $ImGuiDockNodeFlags_PassthruCentralNode) Then $window_flags = BitOR($window_flags, $ImGuiWindowFlags_NoBackground)

    _ImGui_PushStyleVarPos($ImGuiStyleVar_WindowPadding, 0, 0)
    _ImGui_Begin("main_dockspace", False, $window_flags)

    if ($opt_fullscreen) Then _ImGui_PopStyleVar(2)

    $dockspace_id = _ImGui_GetID("MyDockSpace")
    _ImGui_DockSpace($dockspace_id, 0, 0, $dockspace_flags)



Link to comment
Share on other sites

Still no success, even with argumentum script version ... 

Still the same error message PLEASE INSTALL THE LATEST VERSION of DIRECTX ?

For Win10 x64 this is already installed on my machine.

Even if the script run in x86 or x64, same error ...?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...