Leaderboard
Popular Content
Showing content with the highest reputation on 08/25/2025 in all areas
-
How do you handle password in your code ?
cramaboule and one other reacted to Jos for a topic
Just to be clear: Whatever you do, the shell command requires the clear text password, so by definition no solution will be safe! 🙂2 points -
_QuoteAutoIt() for strings in code that contain quote
Trong and one other reacted to AspirinJunkie for a topic
Are you aware that you can escape the respective quote characters in AutoIt string definitions by simply doubling them? So to create an AutoIt-compliant string definition for the AutoIt code itself from a string, you do not need to split it into individual strings and reassemble them, but simply double the quotes. This would be shorter, probably clearer and also better performing. In concrete terms, the following should also achieve your actual goal $result = '"' & StringReplace($raw, '"', '""', 0, 1) & '"' ; or equally: $result = "'" & StringReplace($raw, "'", "''", 0, 1) & "'"2 points -
Write an eula for the end user; that they have to cover their eyes when executing the binary?1 point
-
WebP v0.5.0 build 2025-08-23 beta
pixelsearch reacted to UEZ for a topic
This depends on the encoding setting. Even if it is lossy it can be larger then lossless. Lossy was at max. quality and lossless is at best compression. Probably image quality is the same...1 point -
How do you handle password in your code ?
SOLVE-SMART reacted to RTFC for a topic
https://www.autoitscript.com/forum/files/file/491-codescannercrypterbundle/1 point -
WebP v0.5.0 build 2025-08-23 beta
UEZ reacted to pixelsearch for a topic
Yes, dll 0.5.1 (Aug 25, 2025) works fine for me on several examples tested (including example09 "create animation from screen capture") . So a big thanks for this For the record, here is the comparative size of 2 "Scaled.webp" just created from "Baby Tux lossless.webp", one with dll 0.5.0 and the second one with dll 0.5.1 Only you know if it's normal that the size of the lossless one (created with dll 0.5.1) is 2Ko smaller than the lossy one (created with dll 0.5.0) ... "Image name = " & StringRegExp($sFile, '.*\\(.*)', 1)[0] & @CRLF & _ "Image size = " & FileGetSize($sFile) & " bytes (" & Ceiling((FileGetSize($sFile) / 1024)) & " KB)" & @CRLF & _ Edit: added size in KB (rounded up)1 point -
Interesting...."Man!" I would love to know how you folks come up with the ideas that you do? 81 lines of code down to 37?!? Wow!! Thanks...as always!!1 point
-
Hello, All of my scripts look as the following: ; ----------------------------------------------- #RequireAdmin ; ----------------------------------------------- #include <NameOfInlcude> ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- NameOfFunction() ; ----------------------------------------------- Func NameOfFunction() EndFunc ;==>NameOfFunction ; ----------------------------------------------- Is this correct...or not?1 point
-
need convert cmd file to au3
SOLVE-SMART reacted to Melba23 for a topic
eltunisie, And what have you tried that has not worked? M231 point -
How do you handle password in your code ?
cramaboule reacted to orbs for a topic
one way would be to use it as intended: do not store the password in your script, instead have your script ask you for the password (via inputBox() for example). this is feasible when you don't need to do it too often. if you do, you can streamline the process by using an external password manager (KeePass for example), which can automatically insert the password when prompted. but that's not how i would go about this. i'd consider storing the username and password in the built-in Windows Credential Manager. you can query it to retrieve the credentials, and have your code insert them where required. now, of course if a malicious actor gains access to your environment, any and all methods suggested are compromised. so i'm assuming the purpose is to prevent someone from discovering your password if all they have is the contents of your script. P.S. if you compile your script to executable, that's the first barrier you can put against prying eyes. if those eyes belong to your over-the-average-curious end user, that should throw them off.1 point -
How do you handle password in your code ?
cramaboule reacted to argumentum for a topic
..I use an ini file with the crypt* functions. The decrypt part takes creativity. I use some string as "salt" plus the date-time of creation of said ini file in UTC but, shhhh, that's my secret Again, my secret is creativity. Then again, just like you, these scripts are not for the public.1 point -
Where does #RequireAdmin go?
ioa747 reacted to argumentum for a topic
..it is working properly, just not in SciTE. SciTE reads the script ( the main script ) and if #RequireAdmin is found, it does it's thing to send to the user level running SciTE, via IPC. AutoIt3, will read all the includes, do it's thing, and if #RequireAdmin is found ( after loading all the related files ) it will request a RunAs. The question is: who in their right mind would place #RequireAdmin in an include. And the answer is obvious. The other question is: if the answer is obvious, does it require a post to ask what it is obviously doing ? I just woke up to the "what if", due to this post, as I would never place a #RequireAdmin anywhere other than the main script because, why would anyone do that. 🤷♂️1 point -
How do you handle password in your code ?
cramaboule reacted to ioa747 for a topic
the easiest but not the safest Just to hide it from prying eyes $sUsername = 'administrator' ;~ $sPassword = 'Pa$$w0rd' ;~ $sPass = StringToBinary($sPassword, 4) ;~ ConsoleWrite("$sPass=" & $sPass & @CRLF) $sPass="0x5061242477307264" ConsoleWrite("$sPassword=" & BinaryToString($sPass, 4) & @CRLF)1 point -
Where does #RequireAdmin go?
ioa747 reacted to argumentum for a topic
..just did the test myself. Better add only in the main script as otherwise the Wrapper that runs in SciTE is not gonna know and will not behave as expected.1 point -
I have two log-ons on this system, "Dell" and RML_user. I am currently logged-in as "Dell" When I launch the script, and If I employ, Local $sSrcPath = "C:\Users\RML_User" - the folder launches and exits as expected. However, when I employ, Local $sSrcPath = "C:\Users\Dell", a different folder view appears and the folder does not exist. The title for "C:\Users\RML_User" is "C:\Users\RML_User". However the title for "C:\Users\Dell" appears to be just "Dell"! Is this because "Dell" is the currently logged-on user? All other folders launch and exit fine...it is just the logged-in user that I seem to having issues with! Please advise.1 point
-
If you need/want to characterize floats beyond just being of datatype "double", you can pick ideas from this code: Local $a = [ _ [0xfff0000000000000, "-infinity"], _ ; 1 11111111111 0000000000000000000000000000000000000000000000000000 ⎫ [0xffefffffffffffff, "smallest negative normal"], _ ; 1 11111111110 1111111111111111111111111111111111111111111111111111 ⎪ [0x8010000000000000, "largest negative normal"], _ ; 1 00000000001 0000000000000000000000000000000000000000000000000000 ⎪ [0x8000000000000000, "negative zero"], _ ; 1 00000000000 0000000000000000000000000000000000000000000000000000 ⎪ [0x0000000000000000, "positive zero"], _ ; 0 00000000000 0000000000000000000000000000000000000000000000000000 ⎬ Numbers you can deal with [0x0010000000000000, "smallest positive normal"], _ ; 0 00000000001 0000000000000000000000000000000000000000000000000000 ⎪ [0x7fefffffffffffff, "largest positive normal"], _ ; 0 11111111110 1111111111111111111111111111111111111111111111111111 ⎪ [0x7ff0000000000000, "+infinity"], _ ; 0 11111111111 0000000000000000000000000000000000000000000000000000 ⎭ [0x800fffffffffffff, "smallest negative denormal"], _ ; 1 00000000000 1111111111111111111111111111111111111111111111111111 ⎫ [0x8000000000000001, "largest negative denormal"], _ ; 1 00000000000 0000000000000000000000000000000000000000000000000001 ⎬ Numbers best avoided unless [0x0000000000000001, "smallest positive denormal"], _ ; 0 00000000000 0000000000000000000000000000000000000000000000000001 ⎪ dealing with extra-small values [0x000fffffffffffff, "largest positive denormal"], _ ; 0 00000000000 1111111111111111111111111111111111111111111111111111 ⎭ [0xfff8000000000001, "-NAN (quiet, denormal)"], _ ; 1 11111111111 1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x >= 1 ⎫ [0xfff0000000000001, "-NAN (signaling, denormal)"], _ ; 1 11111111111 00xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x >= 1 ⎪ [0xfff4000000000001, "-NAN (signaling, normal)"], _ ; 1 11111111111 0100000000000000000000000000000000000000000000000000 ⎪ [0x7ff4000000000001, "+NAN (signaling, normal)"], _ ; 0 11111111111 0100000000000000000000000000000000000000000000000000 ⎬ You shouldn't get those [0x7ff8000000000001, "+NAN (quiet, denormal)"], _ ; 0 11111111111 1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x >= 1 ⎪ [0x7ff0000000000001, "+NAN (signaling, denormal)"], _ ; 0 11111111111 00xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x >= 1 ⎭ [0xfff8000000000000, " NAN (indeterminate)"] _ ; 1 11111111111 1000000000000000000000000000000000000000000000000000 ◀ You made a big mistake ] ConsoleWrite("Ranges of double values" & @LF) Local $t = DllStructCreate("int64") Local $u = DllStructCreate("double", DllStructGetPtr($t)) Local $v For $n = 0 To UBound($a) - 1 DllStructSetData($t, 1, $a[$n][0]) $v = DllStructGetData($u, 1) ConsoleWrite(StringFormat("%s%23s\t%s\n", VarGetType($v), $v, $a[$n][1])) Next ConsoleWrite(@LF & "FP zeroes are signed !" & @LF) ConsoleWrite(" 0/3" & @TAB & (0/3) & @LF) ConsoleWrite("-0/-3" & @TAB & (-0/-3) & @LF) ConsoleWrite(" 0/-3" & @TAB & (0/-3) & @LF) ConsoleWrite("-0/3" & @TAB & (-0/3) & @LF) ConsoleWrite("Yet (hopefully)" & @LF) ConsoleWrite("0/-3 = 0/3" & @TAB & (0/-3 = 0/3) & @LF) ConsoleWrite("0/-3 = 0" & @TAB & (0/3 = 0) & @LF) ConsoleWrite(@LF & "Infinities compute (but if you get there, you are mostly stuck!)" & @LF) Local Const $PI = 3.141592653589793 ConsoleWrite("3/0" & @TAB & @TAB & (3/0) & @LF) ConsoleWrite("3/0 + 100" & @TAB & (3/0 + 100) & @LF) ConsoleWrite("(3/0) / 2" & @TAB & ((3/0) / 2) & @LF) ConsoleWrite("(3/0) ^ 2" & @TAB & ((3/0) ^ 2) & @LF) ConsoleWrite("-3/0" & @TAB & @TAB & (-3/0) & @LF) ConsoleWrite("-3/0 + 100" & @TAB & (-3/0 + 100) & @LF) ConsoleWrite("(-3/0) / 2" & @TAB & ((-3/0) / 2) & @LF) ConsoleWrite("(-3/0) ^ 2" & @TAB & ((-3/0) ^ 2) & @LF) ConsoleWrite("(-3/0) ^ 5" & @TAB & ((-3/0) ^ 5) & @LF) ConsoleWrite("Log(1/0)" & @TAB & Log(1/0) & @LF) ConsoleWrite("Exp(1/0)" & @TAB & Exp(1/0) & @LF) ConsoleWrite("Tan($Pi/2)" & @TAB & Tan($Pi/2) & @TAB & "<-- should be 'inf'" & @LF) ConsoleWrite("Tan(-$Pi/2)" & @TAB & Tan(-$Pi/2) & @TAB & "<-- should be '-inf'" & @LF) ConsoleWrite("ATan(1/0)" & @TAB & ATan(1/0) & @TAB & @TAB & "<-- Pi/2" & @LF) ConsoleWrite("ATan(-1/0)" & @TAB & ATan(-1/0) & @TAB & "<-- -Pi/2" & @LF) ConsoleWrite("1/(1/0)" & @TAB & @TAB & 1/(1/0) & @LF) ConsoleWrite("-1/(1/0)" & @TAB & -1/(1/0) & @LF) ConsoleWrite("1/(-1/0)" & @TAB & 1/(-1/0) & @LF) ConsoleWrite("-1/(-1/0)" & @TAB & -1/(-1/0) & @LF) ConsoleWrite("0^0)" & @TAB & @TAB & 0^0 & @TAB & @TAB & @TAB & "<-- NOT indeterminate in FP" & @LF) ConsoleWrite("(1/0)^0" & @TAB & @TAB & (1/0)^0 & @TAB & @TAB & @TAB & "<-- NOT indeterminate in FP" & @LF) ConsoleWrite(@LF & "Indeterminate forms" & @LF) Local $ind = [ _ ["0/0", 0/0], _ ["0*(1/0)", 0*(1/0)], _ ["0*(-1/0)", 0*(-1/0)], _ ["(1/0)-(1/0)", (1/0)-(1/0)], _ ["(-1/0)-(-1/0)", (-1/0)-(-1/0)], _ ["(1/0)+(-1/0)", (1/0)+(-1/0)], _ ["(-1/0)+(1/0)", (-1/0)+(1/0)], _ ["1^(1/0)", 1^(1/0)], _ ["1^(-1/0)", 1^(-1/0)], _ ["-1^(1/0)", -1^(1/0)], _ ["-1^(-1/0)", -1^(-1/0)], _ ["Cos(1/0)", Cos(1/0)], _ ["Sin(1/0)", Sin(1/0)], _ ["ACos(5)", ACos(5)], _ ["ASin(5)", ASin(5)], _ ["Sqrt(-1)", Sqrt(-1)], _ ["Log(-1)", Log(-1)] _ ] For $i = 0 To UBound($ind) - 1 ConsoleWrite(StringFormat("%-15s\t%s\t%f\n", $ind[$i][0], VarGetType($ind[$i][1]), $ind[$i][1])) Next ConsoleWrite(@LF & "NANs never compare !" & @LF) ConsoleWrite("0/0 > 0" & @TAB & @TAB & (0/0 > 0) & @LF) ConsoleWrite("0/0 = 0" & @TAB & @TAB & (0/0 = 0) & @LF) ConsoleWrite("0/0 < 0" & @TAB & @TAB & (0/0 < 0) & @LF) ConsoleWrite("0/0 > -0/0" & @TAB & (0/0 > -0/0) & @LF) ConsoleWrite("0/0 = -0/0" & @TAB & (0/0 = -0/0) & @LF) ConsoleWrite("0/0 < -0/0" & @TAB & (0/0 < -0/0) & @LF)1 point
-
WebP v0.5.0 build 2025-08-23 beta
UEZ reacted to pixelsearch for a topic
@UEZ hi Before you created this WebP thread, when I needed to view a WebP image (outside of a Browser) then I used the well-known application IrfanView in its portable version, "freeware for non-commercial use" as stated on the developer page. Actual version is 4.72 (dated June 2025) and supports all OS's from Windows XP to Windows 11 . There are 59 possible plugins in a zip file and we can add the one we want : the only one I always add (when upgrading) is WebP.dll (last version from January 20, 2025) Now that you created this thread and all your examples, I prefer to use your example01 to view a WebP image. But as the image is scaled at 75% in example01, then I quickly adapted your code to a new example01.1 without the scale process, to view the image in its full size. The script example01.1 goes like this : ;Coded by UEZ #AutoIt3Wrapper_UseX64=y #include "WebP.au3" If WebP_Ver2() < "0.4.4" Then Exit MsgBox($MB_ICONERROR, "ERROR", "DLL Version v0.4.4+ required!", 30) Global $sFile = FileOpenDialog("Select an image", "", "Images (*.webp)") If @error Then Exit Global Const $STM_SETIMAGE = 0x0172 _GDIPlus_Startup() Global Const $hImage = WebP_BitmapCreateGDIp($sFile, False, (WebP_GetImageQuality($sFile) < 30 ? True : False)) ;load webp image as gdiplus, dither output image when qualitiy is below 30. If Not $hImage Then _GDIPlus_Shutdown() Exit MsgBox($MB_ICONERROR, "Error", "Something went wrong loading the WebP image", 15) EndIf Global Const $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) ;convert gdiplus image to gdi image _GDIPlus_ImageDispose($hImage) ;dispose gdiplus image ;get image dimension from gdi image Global $tDim = DllStructCreate($tagBITMAP) DllCall("gdi32.dll", "int", "GetObject", "int", $hBitmap, "int", DllStructGetSize($tDim), "ptr", DllStructGetPtr($tDim)) Global Const $iW = DllStructGetData($tDim, "bmWidth"), $iH = DllStructGetData($tDim, "bmHeight") ;display full size image in GUI Global Const $hGUI = GUICreate("WebP Image Viewer", $iW, $iH) GUISetBkColor(0xFFFFFF) Global Const $iPic = GUICtrlCreatePic("", 0, 0, $iW - 1, $iH - 1) _WinAPI_DeleteObject(GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap)) GUISetState() _WinAPI_DeleteObject($hBitmap) ;dispose gdi image _GDIPlus_Shutdown() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Then I simply added one line in "WebP Example Lister.au3" to call example01.1 directly from the lister, so this code... ["01", "WebP Example01.au3", "View WebP image (from file, shrinked at 75%)"], _ ["02", "WebP Example02.au3", "View WebP image (from memory, full size)"], _ becomes... ["01", "WebP Example01.au3", "View WebP image (from file, shrinked at 75%)"], _ ["01.1", "WebP Example01.1.au3", "View WebP image (from file, full size)"], _ ["02", "WebP Example02.au3", "View WebP image (from memory, full size)"], _ It seems to work fine, but to make sure, could you please be kind enough and check if everything is correct in the example01.1 script ? Thanks !1 point -
The work speaks for itself. ; https://www.autoitscript.com/forum/topic/213089-click-fun/#findComment-1545452 ;---------------------------------------------------------------------------------------- ; Title...........: _Explosion.au3 ; Description.....: Simulates an explosion effect on a series of popup windows. ; AutoIt Version..: 3.3.16.1 Author: ioa747 Script Version: 0.3 ; Note............: Testet in Win10 22H2 Date:28/08/2025 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <WindowsConstants.au3> #include <Math.au3> #include <GUIConstantsEx.au3> #include <WinAPIConstants.au3> _Example() Func _Example() Local $hGUI = GUICreate('Fireworks Example', 500, 300) Local $idBtn_Click = GUICtrlCreateButton("Click", 400, 270, 85, 25) Local $idBtn_Close = GUICtrlCreateButton("Close", 300, 270, 85, 25) GUISetState(@SW_SHOW) Local $msg, $aPos While True $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ; standard window close GUIDelete($hGUI) Sleep(50) $aPos = MouseGetPos() _Explosion($aPos[0] - 250, $aPos[1] + 150, 20) ExitLoop Case $idBtn_Close ; The window will shrink and then explode. $aPos = _Shrink($hGUI) _Explosion($aPos[0], $aPos[1]) ExitLoop Case $idBtn_Click ; explosion at the mouse cursor position. $aPos = MouseGetPos() _Explosion($aPos[0], $aPos[1]) EndSwitch WEnd EndFunc Func _Shrink($hWin, $iSteps = 10) Local $aWPos = WinGetPos($hWin) Local $iCenterX = $aWPos[0] + ($aWPos[2] / 2) Local $iCenterY = $aWPos[1] + ($aWPos[3] / 2) Local $iNewW, $iNewH, $iNewX, $iNewY For $i = 1 To $iSteps $iNewW = $aWPos[2] - ($i * $aWPos[2] / $iSteps) $iNewH = $aWPos[3] - ($i * $aWPos[3] / $iSteps) $iNewX = $aWPos[0] + (($aWPos[2] - $iNewW) / 2) $iNewY = $aWPos[1] + (($aWPos[3] - $iNewH) / 2) WinMove($hWin, '', $iNewX, $iNewY, $iNewW, $iNewH) Sleep(10) Next GUIDelete($hWin) Local $aPos[] = [$iCenterX, $iCenterY] Return $aPos EndFunc Func _Explosion($iX, $iY, $iFragments = 10) Local Const $aColors[5] = [0xFFD800, 0xFFFFFF, 0xD59262, 0x808141, 0x3B3C23] Local $aGUI[$iFragments][7] ; GUICreate For $i = 0 To $iFragments - 1 $aGUI[$i][1] = $iX ; x $aGUI[$i][2] = $iY ; y $aGUI[$i][3] = Random(5, 15, 1) ; w $aGUI[$i][4] = $aGUI[$i][3] ; h $aGUI[$i][5] = Random(15, 25, 1) ; speed $aGUI[$i][6] = $i * (360 / $iFragments); direction (circular) $aGUI[$i][0] = GUICreate('', $aGUI[$i][3], $aGUI[$i][4], $aGUI[$i][1], $aGUI[$i][2], $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST)) GUISetBkColor($aColors[Random(0, UBound($aColors) - 1, 1)]) GUISetState(@SW_SHOWNOACTIVATE) Next While 1 Local $bActive = False For $i = 0 To $iFragments - 1 If WinExists($aGUI[$i][0]) Then $bActive = True Local $fRad = _Radian($aGUI[$i][6]) $aGUI[$i][1] += ($aGUI[$i][5] * Cos($fRad)) $aGUI[$i][2] += ($aGUI[$i][5] * Sin($fRad)) $aGUI[$i][3] -= 1 $aGUI[$i][4] -= 1 $aGUI[$i][5] *= 0.95 WinMove($aGUI[$i][0], '', $aGUI[$i][1], $aGUI[$i][2], $aGUI[$i][3], $aGUI[$i][4]) If $aGUI[$i][3] <= 1 Or $aGUI[$i][4] <= 1 Then GUIDelete($aGUI[$i][0]) EndIf Next If Not $bActive Then ExitLoop Sleep(10) WEnd EndFunc have fun Thank you very much1 point