Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/03/2023 in all areas

  1. I had a search around on how to do dark windows properly and found this elegant solution on GitHub, but did not see it posted here so thought I would connect the 2. SkyEmie is the creator and deserves a round of applause, also the first time I have seen If statements done this way. Yay for learning new things. This little draft demonstrates how to switch from a light theme, to a dark application title bar with AutoIT, using DWM api. ยท GitHub ; This little draft demonstrates how to switch from a light theme, to a dark application title bar with AutoIT, using DwmAPI. ; It will probably be useful to someone who wants to do this, without any headache. ; Because windows does not have any official documentation on this subject today :s #include <GUIConstantsEx.au3> #notrayicon opt('guioneventmode', 1) #cs ---------------------------------------------------------------------------- Function : is_app_dark_theme() Description : returns if the user has enabled the dark theme for applications in the Windows settings (0 on / 1 off) if OS too old (key does not exist) the key returns nothing, so function returns False #ce ---------------------------------------------------------------------------- func is_app_dark_theme() return(regread('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize', 'AppsUseLightTheme') == 0) ? True : False endfunc #cs ---------------------------------------------------------------------------- Function : set_dark_theme($hwnd, $dark_theme = True) Description : set to the handle, the attribute to define whether dark/light theme #ce ---------------------------------------------------------------------------- func set_dark_theme($hwnd, $dark_theme = True) ; before this build set to 19, otherwise set to 20, no thanks Windaube to document anything ?? $DWMWA_USE_IMMERSIVE_DARK_MODE = (@osbuild <= 18985) ? 19 : 20 $dark_theme = ($dark_theme == True) ? 1 : 0 dllcall( _ 'dwmapi.dll', _ 'long', 'DwmSetWindowAttribute', _ 'hwnd', $hwnd, _ 'dword', $DWMWA_USE_IMMERSIVE_DARK_MODE, _ 'dword*', $dark_theme, _ 'dword', 4 _ ) endfunc ; create gui $gui_hwnd = guicreate('Tiny gui', 800, 450) guisetonevent($GUI_EVENT_CLOSE, 'gui_close') ; if dark theme enabled for apps in windows settings, set dark theme to gui if is_app_dark_theme() == True then set_dark_theme($gui_hwnd, True) endif ; display gui guisetstate(@sw_show) while 1 sleep(10) wend func gui_close() exit endfunc
    2 points
  2. I am not familiar with that script so guess that is why. Ok, Have been messing a lot with the messages between all the different AutoIt3Wrapper instances and think I am getting close now. The mod you proposed is made for the tmp script and have hopefully fixed the closing of all scripts in all the different scenarios. Latest version in Beta. Jos
    2 points
  3. Just uploaded SciTEx86.zip & SciTEx64.zip which contain the Latest SciTE 5.4.0 versions.
    2 points
  4. jugador

    RegisterActiveObject

    reference post https://www.autoitscript.com/forum/topic/202618-implementing-irunningobjecttable-interface/?do=findComment&comment=1525707 Main.au3 #include "RegisterActiveObject UDF3.au3" __ExampleA() Func __ExampleA() Local $s_Clsid Local $o_object = __RegisterActiveObject(Default, $s_Clsid) If @error Or Not IsObj($o_object) Then Return Local $aArray[2] = ["Item A0", "item A1"] $o_object.add("String", 'Apple') $o_object.add("Number", 12345) $o_object.add("Array", $aArray) ConsoleWrite('$o_object -> Count item: ' & $o_object.Count & @CRLF) RunWait( @AutoItExe & " /AutoIt3ExecuteScript " & '"Client.au3" ' & $s_Clsid) ConsoleWrite('$o_object -> Count item: ' & $o_object.Count & @CRLF) __RevokeActiveObject() EndFunc Client.au3 MsgBox( 0, "Client", "Client Started" ) __Client($CmdLine[1]) Func __Client($o_Clsid) Local $m_object = ObjGet("", $o_Clsid) If Not IsObj($m_object) Then Return MsgBox(0, "Client", '$m_object -> Count item: ' & $m_object.Count) $m_object.add("Double", 567.55) MsgBox( 0, "Client", "client End" ) EndFunc for connect to vbscipt change this line of Main.au3 RunWait( @AutoItExe & " /AutoIt3ExecuteScript " & '"Client.au3" ' & $s_Clsid) to RunWait( 'wscript.exe "Client.vbs" ' & ObjName($o_object, 3)) Client.vbs Dim Arg Arg = WScript.Arguments(0) Set M_object = GetObject(, Arg) msgbox VarType(M_object) & " " & TypeName(M_object) msgbox M_object.Count M_object.Add "Double", 567.55 Set M_object = Nothing RegisterActiveObject UDF2.au3 RegisterActiveObject UDF3.au3
    1 point
  5. @argumentum You've been inspired to create a radioactive border. We need to be careful about what we post because you are inspired to do strange things.
    1 point
  6. you inspired me #include <GUIConstantsEx.au3> #notrayicon opt('guioneventmode', 1) ; create gui $gui_hwnd = guicreate('Tiny gui', 800, 450) guisetonevent($GUI_EVENT_CLOSE, 'gui_close') set_BorderColor($gui_hwnd, 0x00ff00) ; for Win 11 22H2 onwards Func set_BorderColor($hwnd, $iBorderColor = 0xFFffffff) ; default is 0xffFFFFFF ; else use 0x00rrggbb $DWMWA_BORDER_COLOR = 34 ; https://www.purebasic.fr/english/viewtopic.php?t=78732 dllcall( _ 'dwmapi.dll', _ 'long', 'DwmSetWindowAttribute', _ 'hwnd', $hwnd, _ 'dword', $DWMWA_BORDER_COLOR, _ 'dword*', $iBorderColor, _ 'dword', 4 ) EndFunc ; display gui guisetstate(@sw_show) while 1 sleep(100) wend func gui_close() exit endfunc Set_BorderColor() Edit: ..I use IsDarkMode() instead of the registry for the dark mode setting.
    1 point
  7. It is also a little hidden in the AutoIt3Wrapper.ini definition, but yes it probably isn't really clearly documented. My laptop also doesn't have a break and need to use fn+b to simulate break.
    1 point
  8. Yes, thank you !. My Bluetooth MX ho my god is so good keyboard, does not have the break key So much for modern keyboards and I was going to ask, .. but then I heard your voice in my brain: "..look at the code.." IniRead($AutoIt3WapperIni, "Other", "SciTE_STOPEXECUTE", '^{BREAK}') So ok, I'll set ^{VOLUME_UP} in the ini. Thanks voice of Jos in my brain
    1 point
  9. How are you listing these exactly? Don't think this is generated from my AutoIt3Wrapper version...right? Scratch that...believe I understand now.
    1 point
  10. I also see another issue which I was sure I tested but seem to fail now: Using the Ctrl+Break stops the process properly, but using SciTE menu Tools/ Stop Executing doesn't stop all shelled scripts, so I need some time to fix&test this.
    1 point
  11. That should now be set correctly by line in this block, which i changed in the last version: right? Case $T_Var = "/runadmin" $Option = "RunAdmin" $x = $x + 1 ; Start IPC channel for this process $IPCA = "AutoIt3Wrapper_RunUserScript" & @AutoItPID $IPCCurrent = $IPCA _FMIPC_Create($IPCA) ; Get PID of Master AutoIt3Wrapper and Send the PID of this elevated version of AutoIt3Wrapper so they can communicate via IPC $PIDM = $CMDLINE[$x] $IPCM = "AutoIt3Wrapper_RunUserScript" & $PIDM ; add PID of the master AutoIt3Wrapper_RunUserScript AutoItWinSetTitle($IPCA) IPCWrite($IPCCurrent, $IPCM, "#$#APID:" & @AutoItPID & "#$#")
    1 point
  12. Yea... moved the AutoItWinSetTitle($IPCA) to the section where the pid is retrieved from the commandline. tnx Sure no issue, just made it shorter while coding for clarity, but no issue putting it back as it was. Updates made in current Beta.
    1 point
  13. Just included the FMIPC UDFs made by @argumentum inside of the AutoIt3Wrapper.au3 to avoid the need for extra downloads and uploaded the updated version to beta. the FMIPC.au3 is removed.
    1 point
  14. yea... the current version of AutoIt3Wrapper requires FMIPC.au3. Not sure whether I will add it internally or not, but please download that as well for now.
    1 point
  15. Seems this are hidden OUs. Need to investigate how to query such objects. Unfortunately I do no longer have access to an Active Directory. So it will take some time and testing needs to be done by you.
    1 point
×
×
  • Create New...