Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/15/2025 in all areas

  1. Hi @WildByDesign, Thank you for the feedback and nice words I'm glad to hear it will be put to good use Thanks for the information about KDE/snoretoast, i will differently look at the codebase later, and see if there is anything I'm missing Edit: And thank you for the star on GitHub
    1 point
  2. Hi @Gianni, Sorry for the late reply. First of all thank you for the nice words . Yes i noticed that, that's why my demo downloads an image instead. I'm not currently sure why it does not work. 🤷‍♂️ I seem to remember some documentation mentioning requirements like maximum response time and file size, but i cannot find that currently. It seems to be the case, when the app is not registered with the system. After adding the registry and registering the COM objects, activationType foreground also works. Again, not sure why, currently. This is a very cool tool for crafting toast UI, thanks Edit: I can see the tool might be available as open source on GitHub, so maybe I'll make an AutoIt version at some point, for fun Ah, thank you
    1 point
  3. ioa747

    AutoIt Snippets

    trick for ToolTip with timer Func _ToolTip($sText, $iX = Default, $iY = Default, $sTitle = "", $iIcon = 0, $iTimeout = 1500, $iOptions = 0) AdlibUnRegister("_ToolTipKiller") ; This prevents the previous timer from closing the new tooltip. ToolTip($sText, $iX, $iY, $sTitle, $iIcon, $iOptions) AdlibRegister("_ToolTipKiller", $iTimeout) EndFunc ;==>_ToolTip Func _ToolTipKiller() ToolTip("") ; Hide the tooltip AdlibUnRegister("_ToolTipKiller") ; unregister itself. EndFunc ;==>_ToolTipKiller Example ; https://www.autoitscript.com/forum/topic/139260-autoit-snippets/page/28/#findComment-1546696 ;---------------------------------------------------------------------------------------- ; Title...........: Trick for ToolTip with timer ; Description.....: Displays a native tooltip with timer. ; AutoIt Version..: 3.3.16.1 Author: ioa747 Script Version: 0.1 ; Note............: Testet in Win10 22H2 Date:16/10/2025 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <GUIConstantsEx.au3> Forms() Func Forms() Local $hGui = GUICreate(@ScriptName, 250, 150, -1, -1) Local $idBtn1 = GUICtrlCreateButton("Button 1", 10, 10, 100, 25) Local $idBtn2 = GUICtrlCreateButton("Button 2", 10, 40, 100, 25) Local $idBtn3 = GUICtrlCreateButton("Button 3", 10, 70, 100, 25) Local $idBtn4 = GUICtrlCreateButton("Button 4", 10, 100, 100, 25) GUISetState(@SW_SHOW, $hGui) While 1 Local $aWPos = WinGetPos($hGui) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idBtn1 _ToolTip("...is clicked", $aWPos[0], $aWPos[1] - 15, "Button 1", 1) Case $idBtn2 _ToolTip("...is clicked", $aWPos[0], $aWPos[1] - 15, "Button 2", 1) Case $idBtn3 _ToolTip("...is clicked", $aWPos[0], $aWPos[1] - 15, "Button 3", 1) Case $idBtn4 _ToolTip("...is clicked", $aWPos[0], $aWPos[1] - 15, "Button 4", 1) EndSwitch WEnd GUIDelete($hGui) EndFunc ;==>Forms Func _ToolTip($sText, $iX = Default, $iY = Default, $sTitle = "", $iIcon = 0, $iTimeout = 1500, $iOptions = 0) AdlibUnRegister("_ToolTipKiller") ; This prevents the previous timer from closing the new tooltip. ToolTip($sText, $iX, $iY, $sTitle, $iIcon, $iOptions) AdlibRegister("_ToolTipKiller", $iTimeout) EndFunc ;==>_ToolTip Func _ToolTipKiller() ToolTip("") ; Hide the tooltip AdlibUnRegister("_ToolTipKiller") ; unregister itself. EndFunc ;==>_ToolTipKiller
    1 point
  4. in my opinion you don't need so many windows (one to activate, and one to deactivate) #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) Opt("MustDeclareVars", 1) Global $Form1, $mForm1Button Global $iWidth = 735, $iHeight = 48, $ixpos = -1, $iypos = -1, $iOpt = 1, $sFontName = "Corbel Bold", $iFontSize = 16, $iFontWt = 800 Forms() ; ----------------------------------------------- Func Forms() $Form1 = GUICreate(" ", 150, 40, 1270, 20) GUISetFont(14, $iFontWt, $GUI_FONTNORMAL, $sFontName) GUISetOnEvent($GUI_EVENT_CLOSE, "_CloseForm") $mForm1Button = GUICtrlCreateButton("Enable Hotkey", 10, 10, 130, 20) GUICtrlSetOnEvent($mForm1Button, "_ColRow") GUISetState(@SW_SHOW, $Form1) ; ----------------- While 1 Sleep(10) WEnd EndFunc ;==>Forms ; ----------------------------------------------- Func _ColRow() Switch @GUI_CtrlId Case $mForm1Button _Togle_NUMPADSUB() EndSwitch EndFunc ;==>_ColRow ; ----------------------------------------------- Func _CloseForm() Switch @GUI_WinHandle Case $Form1 Exit EndSwitch EndFunc ;==>_CloseForm ; ----------------------------------------------- Func _Togle_NUMPADSUB() Local Static $bEnabled = True Local $aGuiPos = WinGetPos($Form1) If $bEnabled Then HotKeySet("{NUMPADSUB}", "UpdateF12SceneData") _ToolTip(" ", $aGuiPos[0], $aGuiPos[1] - 10, "HotKey is now enabled", 1, 2000) GUICtrlSetData($mForm1Button, "Disable Hotkey") GUICtrlSetBkColor($mForm1Button, 0xCAE4FF) ; ⚠ extra color indicator Else HotKeySet("{NUMPADSUB}") _ToolTip(" ", $aGuiPos[0], $aGuiPos[1] - 10, "HotKey is now disabled...", 3, 2000) GUICtrlSetData($mForm1Button, "Enable Hotkey") GUICtrlSetBkColor($mForm1Button, 0xE1E1E1) ; ⚠extra color indicator Sleep(1500) ; give time to show the _ToolTip WinClose($Form1) EndIf $bEnabled = Not $bEnabled EndFunc ;==>_TogleF10 ; ----------------------------------------------- Func UpdateF12SceneData() _ToolTip(" ", @DesktopWidth / 2, @DesktopHeight / 3, "UpdateF12SceneData ... do your staff", 2) EndFunc ;==>_CallF10 ; ----------------------------------------------- ; ToolTip functions Func _ToolTip($s_Text, $i_X = Default, $i_Y = Default, $s_Title = "", $i_Icon = 0, $i_Timeout = 1500, $iOptions = 0) AdlibUnRegister("_ToolTipKiller") ; This prevents the previous timer from closing the new tooltip. ToolTip($s_Text, $i_X, $i_Y, $s_Title, $i_Icon, $iOptions) AdlibRegister("_ToolTipKiller", $i_Timeout) EndFunc ;==>_ToolTip ; ----------------------------------------------- Func _ToolTipKiller() ToolTip("") ; Hide the tooltip AdlibUnRegister("_ToolTipKiller") ; unregister itself. EndFunc ; ----------------------------------------------- Edit: I left the old ones so you can see the differences.
    1 point
  5. Melba23

    CHANGED LANGUAGE

    boy15, Welcome to the AutoIt forums. But I am afrid that we need some more information before we can even begin to help. Can you please post a small example script which exhibits this behaviour and also let us know what languages are being corrupted. Then perhaps we can make some sensible suggestions. M23
    1 point
  6. UEZ

    AutoIt Snippets

    I don't know if something like this has already been posted. DarkMode API Calls (undocumented): ;Coded by UEZ build 2025-10-10 ;IMMERSIVE_HC_CACHE_MODE Enum $IHCM_USE_CACHED_VALUE, $IHCM_REFRESH Enum $Default, $AllowDark, $ForceDark, $ForceLight, $Max ;$iPreferredAppMode ;~ Enum $DWMWA_USE_IMMERSIVE_DARK_MODE = (@OSBuild <= 18985) ? 19 : 20 Func _WinAPI_ShouldAppsUseDarkMode() Local $aResult = DllCall("UxTheme.dll", "bool", 132) If @error Then Return SetError(1, 0, False) Return ($aResult[0] <> 0) EndFunc ;==>_WinAPI_ShouldAppsUseDarkMode Func _WinAPI_AllowDarkModeForWindow($hWND, $bAllow = True) Local $aResult = DllCall("UxTheme.dll", "bool", 133, "hwnd", $hWND, "bool", $bAllow) If @error Then Return SetError(1, 0, False) Return ($aResult[0] <> 0) EndFunc ;==>_WinAPI_AllowDarkModeForWindow Func _WinAPI_AllowDarkModeForApp($bAllow = True) ;Windows 10 Build 17763 Return _WinAPI_SetPreferredAppMode($bAllow ? 1 : 0) ; 1 = AllowDark, 0 = Default EndFunc ;==>_WinAPI_AllowDarkModeForApp Func _WinAPI_SetPreferredAppMode($iPreferredAppMode) ;Windows 10 Build 18362+ Local $aResult = DllCall("UxTheme.dll", "long", 135, "long", $iPreferredAppMode) If @error Then Return SetError(1, 0, False) Return $aResult[0] EndFunc ;==>_WinAPI_SetPreferredAppMode Func _WinAPI_FlushMenuThemes() Local $aResult = DllCall("UxTheme.dll", "none", 136) If @error Then Return SetError(1, 0, False) Return True EndFunc ;==>_WinAPI_FlushMenuThemes Func _WinAPI_RefreshImmersiveColorPolicyState() Local $aResult = DllCall("UxTheme.dll", "none", 104) If @error Then Return SetError(1, 0, False) Return True EndFunc ;==>_WinAPI_RefreshImmersiveColorPolicyState Func _WinAPI_IsDarkModeAllowedForWindow($hWND) Local $aResult = DllCall("UxTheme.dll", "bool", 137, "hwnd", $hWND) If @error Then Return SetError(1, 0, False) Return ($aResult[0] <> 0) EndFunc ;==>_WinAPI_IsDarkModeAllowedForWindow Func _WinAPI_GetIsImmersiveColorUsingHighContrast($iIMMERSIVE_HC_CACHE_MODE) Local $aResult = DllCall("UxTheme.dll", "bool", 106, "long", $iIMMERSIVE_HC_CACHE_MODE) If @error Then Return SetError(1, 0, False) Return ($aResult[0] <> 0) EndFunc ;==>_WinAPI_GetIsImmersiveColorUsingHighContrast Func _WinAPI_OpenNcThemeData($hWND, $tClassList) Local $aResult = DllCall("UxTheme.dll", "hwnd", 49, "hwnd", $hWND, "struct*", $tClassList) If @error Then Return SetError(1, 0, False) Return $aResult[0] EndFunc ;==>_WinAPI_OpenNcThemeData Func _WinAPI_ShouldSystemUseDarkMode() Local $aResult = DllCall("UxTheme.dll", "bool", 138) If @error Then Return SetError(1, 0, False) Return ($aResult[0] <> 0) EndFunc ;==>_WinAPI_ShouldSystemUseDarkMode Func _WinAPI_IsDarkModeAllowedForApp() Local $aResult = DllCall("UxTheme.dll", "bool", 139) If @error Then Return SetError(1, 0, False) Return ($aResult[0] <> 0) EndFunc ;==>_WinAPI_IsDarkModeAllowedForApp Requires OSBuild > 17762! API may change in next Windows updates! PS: I've reinvented the wheel ->
    1 point
×
×
  • Create New...