thedemons Posted July 6, 2020 Posted July 6, 2020 (edited) Introduction 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. Features 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. Preview Usage #include <WinAPI.au3> #include "ImGui.au3" ; Create a window Local $hwnd = _ImGui_GUICreate("AutoIt ImGui", 1024, 768) _WinAPI_ShowWindow($hwnd) ; Set style color _ImGui_StyleColorsLight() ;~ _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_BeginFrame() _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?") _ImGui_End() ; must call _ImGui_EndFrame() Wend Remark 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 Require: DirectX GitHub: imgui-autoit Edited July 9, 2020 by thedemons argumentum, kevinalberts, careca and 1 other 1 3
ptrex Posted July 8, 2020 Posted July 8, 2020 I tried it on a x64 Win 10... But there is an error Cannot load imgui.dll Please update to the latest version of DirectX Event though I have DirectX v12 installed. Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
careca Posted July 8, 2020 Posted July 8, 2020 I get the same, screenshots look great though. Spoiler 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 Au3Record.exe
thedemons Posted July 8, 2020 Author Posted July 8, 2020 (edited) Please replace the imgui.dll with the one in dll_64, or #AutoIt3Wrapper_UseX64=N to use x86 Edited July 8, 2020 by thedemons
nend Posted July 8, 2020 Posted July 8, 2020 (edited) Just test it but I also get the same error as above. I tried the step you discribe above but still it doesn't work. On Windows 10 64 bit. Edited July 8, 2020 by nend
argumentum Posted July 8, 2020 Posted July 8, 2020 (edited) 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") Exit EndIf OnAutoItExitRegister(Shutdown_) Func Shutdown_() If $__imgui_created Then _ImGui_ShutDown() DllClose($IMGUI_DLL) ;~ FileDelete($__imgui_dllpath) EndFunc ... ... Q: How can the _ImGui_GUICreate() be dock to the main GUI ? Edited July 8, 2020 by argumentum Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
thedemons Posted July 8, 2020 Author Posted July 8, 2020 The main GUI is created by _ImGui_GuiCreate, did you mean how to dock a window created with _ImGui_Begin to the main GUI like this video below? Spoiler bandicam 2020-07-09 06-23-17-184.mp4
argumentum Posted July 8, 2020 Posted July 8, 2020 yes, that dock but of the main gui Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
thedemons Posted July 8, 2020 Author Posted July 8, 2020 (edited) Please be more clear, dock what to what? Also, this is a problem of imgui, so you can just google with "imgui c++ dock....". Edited July 8, 2020 by thedemons
argumentum Posted July 8, 2020 Posted July 8, 2020 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. thedemons 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
thedemons Posted July 8, 2020 Author Posted July 8, 2020 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_SetNextWindowViewport($viewport.ID) _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) _ImGui_PopStyleVar() if ($opt_fullscreen) Then _ImGui_PopStyleVar(2) $dockspace_id = _ImGui_GetID("MyDockSpace") _ImGui_DockSpace($dockspace_id, 0, 0, $dockspace_flags) _ImGui_End() EndFunc argumentum 1
ptrex Posted July 9, 2020 Posted July 9, 2020 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 ...? Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
thedemons Posted July 9, 2020 Author Posted July 9, 2020 (edited) That is because the dll can't be load. please try to update your Visual C++ Edit: I have updated the new dll built with a lower version of windows SDK, maybe my version of SDK was too high. Edited July 9, 2020 by thedemons
argumentum Posted July 9, 2020 Posted July 9, 2020 (edited) ..tell you what. Did the update on a machine that did not run in but did not help ( purple screen ). The PC that did run is an older version of Win10 ( brown screen ) can the DLL be compiled without dependencies ? Edited February 10, 2024 by argumentum replaced image provider (need the space) Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
argumentum Posted July 9, 2020 Posted July 9, 2020 22 minutes ago, thedemons said: Edit: I have updated the new dll built with a lower version of windows SDK, maybe my version of SDK was too high. Those new DLLs did not fix the issue. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
thedemons Posted July 9, 2020 Author Posted July 9, 2020 The dll is using directx 11 which is prettey much installed on every machine, i think the problem is the windows SDK i used to build the dll. I have updated a new version of the dll, can you try again?
argumentum Posted July 9, 2020 Posted July 9, 2020 ...that was fast !. ... give me 1 minute... Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
thedemons Posted July 9, 2020 Author Posted July 9, 2020 I don't know why is the dll can't be loaded on your pc, i've installed a new windows in vmware, and just need to install DirectX to get it working.
ptrex Posted July 9, 2020 Posted July 9, 2020 You can check your DirectX version running this tool : dxdiag.exe On Windows 10 x64 using latest updates it will be Directx v12 Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now