Jump to content

Leaderboard

Popular Content

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

  1. The starting digit is 0 not 1, so it is 256 levels of transparency.
    2 points
  2. ConsoleWrite( myPercentThing(200) & @CRLF) ConsoleWrite( myPercentThing(100) & @CRLF) ConsoleWrite( myPercentThing(50) & @CRLF) ConsoleWrite( myPercentThing(0) & @CRLF) ConsoleWrite( myPercentThing(-1000) & @CRLF) Func myPercentThing($vDecimal) $vDecimal = ($vDecimal < 0 ? 0 : $vDecimal) $vDecimal = ($vDecimal > 100 ? 100 : $vDecimal) Return Ceiling($vDecimal * 2.55) ; round up EndFunc 0 visibility is totally transparent. Make a minimum of 50 🤔
    2 points
  3. Your math is always sharp. Thank you so much.
    2 points
  4. Not if you format the function headers in the correct way, then you just need to prepare a few text files and run a script. Please see Simple Library Docs Generator
    2 points
  5. Nine

    GIF Animation (cached)

    After giving it some thoughts, I went with a callback function to modify any aspect of the GIF frame by frame. You need to provide a valid callback function receiving a GDI+ image handle (originating from the GIF) and returning a modified GDI+ handle to fit the size of the GIF control creation. A few tests showed me that the callback function seems to be the fastest approach. Added a basic example showing how to use the callback. New version available
    2 points
  6. Yes, the optimization part definitely works. I can see several issues on their GitHub repo where they were going to finally implement a proper fullscreen mode but it seemed to have always gotten delayed, pushed off to another issue or cancelled. So I wont hold my breath on that one. But I am happy with the optimizations. This proved to be correct. I decided to patch my AutoIt binary and sure enough, the console messages are coming though. That is interesting. I guess that is a limitation of the registry (external manifest) method, unfortunately.
    1 point
  7. That's interesting about the full screen. You're probably on the money - Its supposed to perform "System Level Optimizations", so I guess that part is working. yep, mine's working fine from scite. I'm still patching my Autoit exe with the manifest rather than using the registry, so not sure if that has something to do with it. Maybe the registry method works for ShellExecute, but not running the exe from the command line? Dunno, just guessing.
    1 point
  8. No. In first place just user should ask how to do some task he wanted. Best in your support topic. Then you/me or other user will be able to explain and show an example. Eventually in the end it can lead us to some kind of helper/wrapper function aka "lite" version, but this still should be based on the default UDF you already created. ps. sorry for the many edits - I feel bad today
    1 point
  9. wakillon

    AutoIt Snippets

    Trick for display your favorite directories in FileSaveDialog and FileOpenDialog with Win 11 The favorite directories are set in registry to : HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\comdlg32\Placesbar Example of Placesbar Reg File Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\comdlg32\Placesbar] "Place1"="C:\\" "Place2"="C:\\Program Files (x86)\\AutoIt3\\Include" "Place4"="D:\\" "Place0"=dword:00000011 "Place3"=dword:00000010 11 is "My Computer" and 10 the Desktop #Region ;************ Includes ************ #Include <WinAPITheme.au3> #EndRegion ;************ Includes ************ $hGui = GUICreate('', 500, 500) GUISetState() ; Default display FileSaveDialog('Save file', @WorkingDir, 'Scripts (*.au3)', $FD_PATHMUSTEXIST, '', $hGui) ; ; Display with PlacesBar _WinAPI_SetThemeAppProperties($STAP_ALLOW_NONCLIENT) FileSaveDialog('Save file', @WorkingDir, 'Scripts (*.au3)', $FD_PATHMUSTEXIST, '', $hGui) FileOpenDialog('Select a file', @WorkingDir & '\', 'Images (*.jpg;*.bmp)', $FD_FILEMUSTEXIST, '', $hGui) ; ; Reset default display _WinAPI_SetThemeAppProperties(-1) FileSaveDialog('Save file', @WorkingDir, 'Scripts (*.au3)', $FD_PATHMUSTEXIST, '', $hGui) GUIDelete($hGui) Exit
    1 point
  10. Thank you for all of the work that you've put into this, Matty. You newest demo is great and showcases the different settings very well and is a great start for anyone wanting to get familiar with the UDF. And the UDF itself is well organized and certainly a much more viable option now for anyone wanting to get started with it. By the way, the 3 or 4 different *SetIsFullWindow functions do work as I've tested True/False with them before and the Get* functions for them report back with the correct value that I had set. From my understanding, though, is that they don't do what we would expect (eg. fullscreen). They seem to do some sort of optimizations because I had some very large 4K videos stutter a bit before and after enabling IsFullWindow, everything is smooth now. I run mine at fullscreen size anyway, but not true fullscreen in that sense though. Question: Have you ever been able to get the video and/or ConsoleWrite to work in VSCode or SciTE? If I run the au3 file from File Explorer, the video works. But when I run it from VSCode or SciTE, the GUI will load but no video and therefore no island, I assume. So I've had to resort to using MsgBox at various stages during testing to get returns on certain things.
    1 point
  11. to be in sync with latest autoit release 3.3.18.0 and Au3Check I update the #include Cheers GUIScape.zip
    1 point
  12. Hi folks, here's a bit of a bonus. All the WinRT stuff is crammed into one include file, then there's the beginnings of another "UDF Layer" on top of that. Its all about simplifying things for people wanting to use this media player control in their projects. "Media player 4 all" type vibes . TBH I probably won't be taking this particular thing much further... It'll be the underlying WinRT class/interface libraries (in the folder structure) getting the development time sorry! So if anyone else wants run with this, feel free, and I'm happy to support if need be. I've used up all my attachment space here - so here's a sourceforge link! PS: its really just something that I threw together last night - so I'm sure there's plenty there to improve on!
    1 point
  13. Hello It was a good job Just having WM_NOTIFY does not cause any problems in small and independent designs, but in projects that use modular connection of different codes, WM_NOTIFY management requires centralized management, which creates problems with accessing global variables In my opinion, we should move the designs towards modularity so that we do not encounter any problems when using them in large designs. In this case, I prefer not to use WM_NOTIFY, which is needed in different places. Although in this example WM_NOTIFY is not very important. @WildByDesign
    1 point
  14. Indeed, my opinion has changed. You were right. With the WinEventHook, I was able to detect single-click and double-click with a relatively decent level of accuracy. However, there was a problem that I didn't realize until later. Drag/selection actions (eg. dragging rectangle on desktop) were still counting as a click and I had no way to detect that with WinEventHook. Then you came along (at the perfect time, by the way) with your 2nd inner While...WEnd loop magic for the IsPressed() function. And that is exactly what I needed. I got rid of the WinEventHook and switched back to only using the IsPressed() function. Now, thanks to you, I am able to detect single-click, double-click and avoid drag/selection actions falsely triggering it. I may still tweak the code a bit, but the follow example is doing exactly what I need now: #include <Misc.au3> #include <WinAPIvkeysConstants.au3> #include <WinAPIMisc.au3> #include <WinAPISysWin.au3> #include <WinAPISys.au3> DllCall("User32.dll", "bool", "SetProcessDpiAwarenessContext" , "HWND", "DPI_AWARENESS_CONTEXT" -4) Global $hUser32 = DllOpen('user32.dll') HotKeySet("{ESC}", Terminate) Example() Func Example() Local $tPoint, $iTimePress, $sParent, $hWndCur, $iTimeRelease Local Static $bSingleLast, $bDouble Local Static $iTimeLast While 1 If _IsPressed($VK_LBUTTON, $hUser32, False) Then $tPoint = _WinAPI_GetMousePos() $hWndCur = _WinAPI_GetAncestor(_WinAPI_WindowFromPoint($tPoint), $GA_ROOT) $sParent = _WinAPI_GetClassName($hWndCur) If $sParent = "Progman" Then $iTimePress = Round((_WinAPI_GetTickCount64() / 1000), 2) $iTimeDiff = $iTimePress - $iTimeLast ;ConsoleWrite("Time: " & $iTimePress & " Diff: " & $iTimeDiff & @CRLF) ; wait until key is released While _IsPressed($VK_LBUTTON, $hUser32, False) Sleep(5) WEnd ; left click has been released $iTimeRelease = Round((_WinAPI_GetTickCount64() / 1000), 2) $iDiffSingle = $iTimeRelease - $iTimePress ;ConsoleWrite("Single-click time: " & $iDiffSingle & @CRLF) If $iDiffSingle < 0.4 Then ; single-click detected If $bSingleLast And $iTimeDiff < 0.4 Then $bDouble = True $bSingleLast = True If $bSingleLast And $bDouble Then ; double-click detected ConsoleWrite("Double-click detected at: " & HourAmPm(@HOUR & ":" & @MIN & ":" & @SEC) & @CRLF) ; reset values $bSingleLast = False $bDouble = False Else If Not $bDouble Then ; single-click detected ConsoleWrite("Single-click detected at: " & HourAmPm(@HOUR & ":" & @MIN & ":" & @SEC) & @CRLF) EndIf EndIf ElseIf $iDiffSingle > 0.4 Then ; possible drag/selection detected $bSingleLast = False $bDouble = False EndIf $iTimeLast = $iTimePress EndIf EndIf Sleep(100) WEnd EndFunc Func Terminate() _IsPressed() Exit EndFunc ;==>Terminate ; #FUNCTION# ==================================================================================================================== ; Name...........: HourAmPm ; Description....: Converts a time in 24-hour format to AM/PM format. ; Syntax.........: HourAmPm( $sDateTime [, $sAmPm = "AM|PM" [, $iTrimRight = 0]] ) ; Parameters.....: $sDateTime - The time (with date or not) string with "HH:" in it. ; $sAmPm - [optional] The AM/PM representation (default is "AM|PM"). ; $iTrimRight - [optional] The number of characters to trim from the right of the result (default is 0). ; $iNoDate - [optional] Whether to omit the date from the output. Defaults to False. ; Return values .: Success: Returns the formatted date and time in AM/PM format. ; Failure: None. ; Author ........: argumentum ; Modified ......: ; Remarks .......: This function takes a 24-hour time string, converts it to AM or PM format, and returns the result with optional trimming. ; Related .......: ; Link ..........: https://www.autoitscript.com/forum/index.php?showtopic=213061 ; Example .......: MsgBox(64, "Converted Time", HourAmPm("12/31/1999 18:59:59")) ; =============================================================================================================================== Func HourAmPm($sDateTime, $sAmPm = Default, $iTrimRight = Default, $iNoDate = Default) Local $aAmPm = StringSplit((StringInStr($sAmPm, "|") ? $sAmPm : "AM|PM"), "|"), $sFormat = $aAmPm[2] Local $iHourPos = StringInStr($sDateTime, ":"), $sHour = StringMid($sDateTime, $iHourPos - 2, 2) Local $sDate = StringLeft($sDateTime, $iHourPos - 3), $sTime = StringTrimLeft($sDateTime, $iHourPos - 1) If $sHour < 12 Then $sFormat = $aAmPm[1] ; https://www.autoitscript.com/forum/index.php?showtopic=213061 $sHour = Mod($sHour, 12) If Not $sHour Then $sHour = 12 Return StringTrimRight((Int($iNoDate) ? "" : $sDate) & StringRight('0' & $sHour, 2) & $sTime, Int($iTrimRight)) & " " & $sFormat EndFunc ;==>HourAmPm
    1 point
  15. Oh man, I was forgetting to not over write the default styles. DOH! ............. On second thought, I'm not sure that's the issue either. Oh well, I'll keep tinkering. I'm sure I can find a solution.
    1 point
  16. Not sure if it helps, but Water has some good stuff out there for building in contextual help from within scite. I've used it over in the midi project, and it works quite well. It is a stupid amount of work though putting together the helpfile.
    1 point
  17. OK, final comments from me on the topic. On my machine, I have a problem with Autoit v3.3.18.0 and SciTE4AutoIT3 v4.4.6 (16th March 2021) working together. I can now reliably introduce the (at least) 5 second delay on file saves when this combination is installed. (I really don't know why it worked yesterday!) Degrading AutoIT3 to v3.3.16.1 OR degrading SciTE4AutoIT3 fixes the problem without changing anything in Windows. I now have Autoit v3.3.18.0 and SciTE4AutoIT3 v4.2.0 (3th September 2019) running together, with no noticeable save delay. For me, the only annoyance is that the SciTE backups now appear in the script folder, instead of a backup folder, which was clearly improved when SciTE4AutoIT3 was updated. The missing declaration 'bug' in SciTe Jump.au3 is in all versions I could find, including in the script in the Beta folder pointed to by Jos' signature. Unfortunately, I don't know how to download and install the Beta version of SciTE4AutIT3 (I'm used to having a Windows 'install' utility), otherwise I'd have given that a try. I have had to install AutoIT and SciTE to a non program folder (C:\Program Files (Legacy)\AutoIT3\) because Windows won't let me correct the bug and save SciTE Jump.au3 in the Programs (x86) folder, due to permissions settings. I seem to be the only one affected by the problem BUT I hope that these observations may help anyone else who may trip over this issue when they have to move from Windows 10 to 11. Thanks everyone John G0GCD
    1 point
  18. Thank you for your kind words, regarding Date/Time Format, take a look at Free style DateTimeFormat
    1 point
  19. @TheSaint I'm glad it helps someone
    1 point
  20. CODE: ; ============================================ ; Functions to check taskbar visibility and position ; ============================================ ; ------------------------------------------------------------ ; Function: _IsTaskbarVisible ; Purpose : Check whether the Windows taskbar is visible ; Return : True - Taskbar is visible ; False - Taskbar is hidden or not found ; Author : Dao Van Trong - TRONG.PRO ; Example : ; If _IsTaskbarVisible() Then MsgBox(0, "Status", "Visible") ; ------------------------------------------------------------ Func _IsTaskbarVisible() ; Get the handle to the taskbar Local $hTaskbar = WinGetHandle("[CLASS:Shell_TrayWnd]") If @error Then Return False ; Taskbar not found ; Get the position and size of the taskbar Local $aPos = WinGetPos($hTaskbar) If @error Then Return False ; Get the screen dimensions Local $iScreenWidth = @DesktopWidth Local $iScreenHeight = @DesktopHeight ; When the taskbar is hidden, its coordinates may be off-screen: ; Top taskbar: Y < 0 ; Left taskbar: X < 0 ; Right taskbar: X + Width > DesktopWidth ; Bottom taskbar: Y + Height > DesktopHeight ; Check if the taskbar is visible If $aPos[0] < 0 Or $aPos[1] < 0 Or _ $aPos[0] + $aPos[2] > $iScreenWidth Or _ $aPos[1] + $aPos[3] > $iScreenHeight Then Return False ; Taskbar is hidden Else Return True ; Taskbar is visible EndIf EndFunc ;==>_IsTaskbarVisible ; ------------------------------------------------------------ ; Function: _GetTaskbarPosition ; Purpose : Get the position of the Windows taskbar ; Return : SetError(0, code, "position") ; code: 1=top, 2=bottom, 3=left, 4=right ; SetError(3, 0, "unknown") if not determined ; Author : Dao Van Trong - TRONG.PRO ; Example : ; $pos = _GetTaskbarPosition() ; MsgBox(0, "Taskbar Position", $pos & " / code: " & @extended) ; ------------------------------------------------------------ Func _GetTaskbarPosition() Local $hTaskbar = WinGetHandle("[CLASS:Shell_TrayWnd]") If @error Then Return SetError(1, 0, "") ; Taskbar not found Local $aPos = WinGetPos($hTaskbar) If @error Then Return SetError(2, 0, "") ; Error getting taskbar position Local $iScreenWidth = @DesktopWidth Local $iScreenHeight = @DesktopHeight Local $tolerance = 5 ; Tolerance threshold in pixels ; Check top/bottom positions If Abs($aPos[0]) <= $tolerance And Abs($aPos[2] - $iScreenWidth) <= $tolerance Then If Abs($aPos[1]) <= $tolerance Then Return SetError(0, 1, "top") If Abs($aPos[1] + $aPos[3] - $iScreenHeight) <= $tolerance Then Return SetError(0, 2, "bottom") EndIf ; Check left/right positions If Abs($aPos[1]) <= $tolerance And Abs($aPos[3] - $iScreenHeight) <= $tolerance Then If Abs($aPos[0]) <= $tolerance Then Return SetError(0, 3, "left") If Abs($aPos[0] + $aPos[2] - $iScreenWidth) <= $tolerance Then Return SetError(0, 4, "right") EndIf ; If taskbar is hidden, infer its position from off-screen coordinates If Not _IsTaskbarVisible() Then If $aPos[1] < 0 Then Return SetError(0, 1, "top") If $aPos[0] < 0 Then Return SetError(0, 3, "left") If $aPos[1] + $aPos[3] - $iScreenHeight > $tolerance Then Return SetError(0, 2, "bottom") If $aPos[0] + $aPos[2] - $iScreenWidth > $tolerance Then Return SetError(0, 4, "right") EndIf Return SetError(3, 0, "unknown") ; Position could not be determined EndFunc ;==>_GetTaskbarPosition ;~ ; ------------------------------------------------------------ ;~ ; Example usage ;~ ; ------------------------------------------------------------ ;~ Local $sPos = _GetTaskbarPosition() ;~ Local $iCode = @extended ;~ If _IsTaskbarVisible() Then ;~ MsgBox(0, "Taskbar Status", _ ;~ "Taskbar is visible" & @CRLF & _ ;~ "Taskbar position: " & $sPos & @CRLF & _ ;~ "Position code : " & $iCode) ;~ Else ;~ MsgBox(0, "Taskbar Status", _ ;~ "Taskbar is hidden" & @CRLF & _ ;~ "Taskbar position: " & $sPos & @CRLF & _ ;~ "Position code : " & $iCode) ;~ EndIf EG: ; ------------------------------------------------------------ ; Example usage ; ------------------------------------------------------------ Local $sPos = _GetTaskbarPosition() Local $iCode = @extended If _IsTaskbarVisible() Then MsgBox(0, "Taskbar Status", _ "Taskbar is visible" & @CRLF & _ "Taskbar position: " & $sPos & @CRLF & _ "Position code : " & $iCode) Else MsgBox(0, "Taskbar Status", _ "Taskbar is hidden" & @CRLF & _ "Taskbar position: " & $sPos & @CRLF & _ "Position code : " & $iCode) EndIf
    1 point
×
×
  • Create New...