Leaderboard
Popular Content
Showing content with the highest reputation on 01/21/2022 in all areas
-
[New Version] - 16 Apr 2022 Added: A new function _GUIExtender_Hidden_Control which allows you to specify which controls should not be automatically reshown when it redraws the GUI. You no longer need to hide/show the control within the script - this function does that as well as telling the UDF whether or not to show it on redraw. New UDF and an additional example in the zip below. Previous changes: Changelog.txt ........................................................................... The GUIExtender UDF allows you to have multiple sections within your GUIs which can be either static or extendable. The extendable sections can be extended and retracted either by UDF created buttons or programmatically by other controls or HotKeys. The controls on the sections are fully functional and there is no overlap problem when retracted (see the details section if you want to know how). The UDF can be used in both MessageLoop and OnEvent modes and with both native and UDF created controls, as well as embedded objects and child GUIs. -------------------------------------------------------------- Note: This is a new recoded and (I hope) simplified version of my earlier UDF of the same name. If you move to this new version there are several script-breaking changes, so please look carefully at the included example scripts to see where things have changed. Here is a quick guide to how the UDF function list has been altered: Old function New function Comment _Init _Init Unchanged _Clear _Clear Unchanged _Section_Start _Section_Create New default parameters for position and size _Section_End Deprecated _Section_Create used to end all section creation _Section_Action _Section_Activate Simple rename _Action _EventMonitor Simple rename _Section_Extend _Section_Action Simple rename, but now uses integer parameter for required state _Section_State _Section_State Unchanged _Restore Deprecated Now automatic _ActionCheck Deprecated Now automatic _HandleCheck Deprecated Now automatic _Obj_Data _Obj_Data Unchanged - _Handle_Data Single call on creation replaces multiple _HandleCheck calls Note: The _EventMonitor function must be added to the idle loop for the automatic actions above to occur -------------------------------------------------------------- Details of how the UDF works for those who are interested: The UDF and plenty of commented examples are in the attached zip: GUIExtender.zip M231 point
-
Version 2021.8.30.2
10,230 downloads
Use MouseClick() need: #RequireAdmin Dll is already integrated in UDF ! ; #INDEX# =============================================================== ; Title .........: ImageSearch ; AutoIt Version : 3.x ; Language ......: English ; Description ...: Check image Appears or Not and Return the position of an image on the desktop ; Author(s) .....: Dao Van Trong - TRONG.LIVE ; ======================================================================= ; #CURRENT# ============================================================= ; _ImageSearch ; _ImageSearch_Area ; _ImageSearch_Wait ; _ImageSearch_WaitArea ; ======================================================================== ;========================================================================= ; ; Author:...........: AutoIT VietNam : Dao Van Trong - TRONG.LIVE ; Description:......: Check image Appears or Not ; Find and return the position of an image on the desktop ; Syntax:........... _ImageSearch_Area, _ImageSearch ; Parameter(s):..... $_ImagePath: The image to locate on the desktop ; May be a list of image by delimited by "|" ; i.e: $_ImagePath = "image1.bmp|image2.bmp|image3.bmp" ; $P_x1 $P_y1: Position of 1st point ; $P_x2 $P_y2: Position of 2nd point - Default is last botton right of desktop ; $_Tolerance: 0 for no tolerance (0-255). Needed when colors of image differ from desktop. e.g GIF ; $_CenterPos: boolen. True will return $array[1] x $array[2] is center of image found. ; False will return top-left position ; Return Value(s):.. Return an array has 3 item ; On Success: $array[0] 1 ; On Failure: $array[0] 0 ; DLL not found or other error: $array[0] -1 ; $array[1] x $array[2]: position of image what found on desktop ; ; Note:............. Use _ImageSearch to search the entire desktop ; _ImageSearch_Area to specify a desktop region to search ; $_ImagePath with more item need more time appear on screen before function can detect. ; Decrease sleep time in the loop to detect faster. But less performance. I.e CPULoad increased ; ;======================================================================== EG 1: ;~ Opt("MustDeclareVars", 1) ;~ #AutoIt3Wrapper_UseX64=y ;~ #AutoIt3Wrapper_Change2CUI=y #RequireAdmin #include "_ImageSearch_UDF.au3" HotKeySet("{Esc}", "_Exit") ; Press ESC for exit Func _Exit() Exit 0 EndFunc ;==>_Exit Global Const $Ask_On_Found = 0 Global Const $Mouse_Move_On_Found = 1 Global Const $Mouse_Click_On_Found = 0 Global Const $iSleep_Time=500 Global $sCount = 0, $_Image_1 = @ScriptDir & "\example.bmp" ; First, use this function to create a file bmp, maybe a desktop icon for example') MsgBox(64 + 262144, 'ImageSearch', 'At first, create a file bmp,' & @CRLF & 'photos that will search on the screen!') _ImageSearch_Create_BMP($_Image_1) ConsoleWrite("! Search for images: " & $_Image_1 & @CRLF & '! Searching on the screen ...' & @CRLF) While 1 ToolTip('(Press ESC for EXIT) Searching ...', 1, 1) Sleep($iSleep_Time) $sCount += 1 Local $return = _ImageSearch($_Image_1) If $return[0] = 1 Then ConsoleWrite('- [' & $sCount & '] Image found:' & " X=" & $return[1] & " Y=" & $return[2] & @CRLF) If $Mouse_Move_On_Found Then MouseMove($return[1], $return[2]) Sleep($iSleep_Time) EndIf If $Mouse_Click_On_Found Then MouseClick("left", $return[1], $return[2]) ToolTip('(Press ESC for EXIT) - [' & $sCount & "] Image found:" & " X=" & $return[1] & " Y=" & $return[2], 1, 1) If $Ask_On_Found Then Local $ask = MsgBox(6 + 262144, 'Success [' & $sCount & ']', 'Image found:' & " X=" & $return[1] & " Y=" & $return[2]) If $ask = 2 Or $ask = 3 Or $ask = 5 Or $ask = 7 Then Exit ;No, Abort, Cancel, and Ignore If $ask = 10 Then _ImageSearch_Create_BMP($_Image_1) ; Continue ;Try Again EndIf EndIf Sleep(200) WEnd Video demo: [+] When any problem or error occurs, please make sure that:- Downloaded and used the latest version.- Set screen Screen Scale and layout = 100%- Installed display driver.- Tried turning off the antivirus- Full installation: Microsoft Visual C++ Redistributable 2005->2022 [+] You can download the AIO version of the Visual C++ Redistributable here: -> https://www.mediafire.com/file/0ak8dcj9mdn7nyq/VisualCppRedist_AIO_2005-2022_x86_x64_%5Btrong.live%5D.zip/file -> FOR Windows XP: https://www.mediafire.com/file/5m5lnr1kfg73tc9/VisualCppRedist_AIO_2005-2019_x86_XP_%5Btrong.live%5D.zip/file <!> Password for Extract: trong.live [+] The last full version of SCITE4AutoIT supports windows XP: https://www.autoitscript.com/autoit3/scite/download/archive/v19.1127.1402.0-SciTE4AutoIt3.exe1 point -
mesale0077 asked me whether I could code some CSS loading animations from different web sites. These are the results using GDI+ (AutoIt v3.3.12.0+ required!): _GDIPlus_MonochromaticBlinker.au3 / _GDIPlus_RotatingBokeh.au3 _GDIPlus_SpinningCandy.au3 / _GDIPlus_SteamPunkLoading.au3 _GDIPlus_IncreasingBalls.au3 / _GDIPlus_PacmanProgressbar.au3 _GDIPlus_StripProgressbar.au3 / _GDIPlus_RingProgressbar.au3 _GDIPlus_LineProgressbar.au3 / _GDIPlus_SimpleLoadingAnim.au3 _GDIPlus_TextFillingWithWater.au3 / _GDIPlus_MultiColorLoader.au3 _GDIPlus_LoadingSpinner.au3 / _GDIPlus_SpinningAndPulsing.au3 _GDIPlus_TogglingSphere.au3 / _GDIPlus_CloudySpiral.au3 _GDIPlus_GlowingText.au3 (thanks to Eukalyptus) / _GDIPlus_HypnoticLoader.au3 _GDIPlus_RotatingRectangles.au3 / _GDIPlus_TRONSpinner.au3 _GDIPlus_RotatingBars.au3 / _GDIPlus_AnotherText.au3 (thanks to Eukalyptus) _GDIPlus_CogWheels.au3 (thanks to Eukalyptus) / _GDIPlus_DrawingText.au3 (thanks to Eukalyptus) _GDIPlus_GearsAnim.au3 / _GDIPlus_LEDAnim.au3 _GDIPlus_LoadingTextAnim.au3 / _GDIPlus_MovingRectangles.au3 _GDIPlus_SpinningAndGlowing.au3 (thanks to Eukalyptus) / _GDIPlus_YetAnotherLoadingAnim.au3 _GDIPlus_AnimatedTypeLoader.au3 / _GDIPlus_Carousel.au3 Each animation function has a built-in example how it can be used. AiO download: GDI+ Animated Wait Loading Screens.7z (previous downloads: 1757) Big thanks to Eukalyptus for providing several examples. Maybe useful for some of you Br, UEZ PS: I don't understand CSS - everything is made out of my mind, so it might be different from original CSS examples1 point
-
For the fun, a one-liner Edit : I saw 'challenge' in the title so I played the game. Obviously I don't recommend such a convoluted way #include <Array.au3> $sVar = @LF & @CRLF _ & 'MainWindowHandle : 132730' _ & @LF & 'Id : 8808' _ & @LF & 'ProcessName : SciTE' _ & @LF & 'CPU : 112.15625' _ & @LF & 'Handles : 512' & @LF & @CRLF $sVar &= 'MainWindowHandle : 656932' _ & @LF & 'Id : 4268' _ & @LF & 'ProcessName : iexplore' _ & @LF & 'CPU : 0.15625' _ & @LF & 'Handles : 400' & @LF & @CRLF $sVar &= 'MainWindowHandle : 1182078' _ & @LF & 'Id : 6748' _ & @LF & 'ProcessName : explorer' _ & @LF & 'CPU : 12.09375' _ & @LF & 'Handles : 1230' & @LF & @CRLF $sVar &= 'MainWindowHandle : 1837220' _ & @LF & 'Id : 6868' _ & @LF & 'ProcessName : explorer' _ & @LF & 'CPU : 6.171875' _ & @LF & 'Handles : 552' & @LF & @CRLF $s = StringTrimRight(StringRegExpReplace(StringSplit(StringStripWS($sVar, 3), @cr)[1], '\h*:\N+\n', "\|"), 1) &@cr& StringRegExpReplace(StringRegExpReplace(StringStripWS($sVar, 3), '(?m)^.+?:\h', "\|"), '((?<=\A|\v\v)\|)|\n', "") Msgbox(0,"", $s) Local $a[0][5] _ArrayAdd($a, $s, 0, "|", @cr) _ArrayDisplay($a)1 point
-
what does 'SRER' mean? ... here my bark belch... #include <String.au3> #include <Array.au3> $sVar = @LF & @CRLF _ & 'MainWindowHandle : 132730' _ & @LF & 'Id : 8808' _ & @LF & 'ProcessName : SciTE' _ & @LF & 'CPU : 112.15625' _ & @LF & 'Handles : 512' & @LF & @CRLF $sVar &= 'MainWindowHandle : 656932' _ & @LF & 'Id : 4268' _ & @LF & 'ProcessName : iexplore' _ & @LF & 'CPU : 0.15625' _ & @LF & 'Handles : 400' & @LF & @CRLF $sVar &= 'MainWindowHandle : 1182078' _ & @LF & 'Id : 6748' _ & @LF & 'ProcessName : explorer' _ & @LF & 'CPU : 12.09375' _ & @LF & 'Handles : 1230' & @LF & @CRLF $sVar &= 'MainWindowHandle : 1837220' _ & @LF & 'Id : 6868' _ & @LF & 'ProcessName : explorer' _ & @LF & 'CPU : 6.171875' _ & @LF & 'Handles : 552' & @LF & @CRLF ; ---------------- $sVar = StringReplace($sVar, @LF & @CR, @CR) Local $aHeaders = _ArrayUnique(_StringBetween($sVar, @LF, ':'), 0, 0, 0, 0) Local $s = _ArrayToString($aHeaders) & @LF ; _ArrayDisplay($aHeaders) For $i = 0 To UBound($aHeaders) - 1 $sVar = StringReplace($sVar, $aHeaders[$i] & ": ", "") Next $sVar = StringReplace($sVar, @LF, '|') Local $aRecords = _StringBetween($sVar, @CR, @CR) For $i = 0 To UBound($aRecords) - 1 $s &= StringTrimLeft($aRecords[$i], 1) & @LF Next $s = StringTrimRight($s, 1) ConsoleWrite($s & @LF) ; goal ; ---------------- _ArrayDisplay(_VarTo2D($s, "|")) Func _VarTo2D($var, $sSeparator = @TAB) Local $aRows = StringSplit(StringStripCR($var), @LF), $aColumns, $aResult[$aRows[0]][1] For $iRow = 1 To $aRows[0] $aColumns = StringSplit($aRows[$iRow], $sSeparator) If $aColumns[0] > UBound($aResult, 2) Then ReDim $aResult[$aRows[0]][$aColumns[0]] For $iColumn = 1 To $aColumns[0] $aResult[$iRow - 1][$iColumn - 1] = $aColumns[$iColumn] Next Next Return $aResult EndFunc ;==>_VarTo2D1 point
-
Now finally I can normally work with github1 point
-
Why is _ArraySort so broken? Updated 1/9/22 630pm g2g
JLogan3o13 reacted to Melba23 for a topic
markyrocks, You just keep on feeling embarrassed for us - no-one else here does. Could it be the two things are connected? A point worth pondering...... Or could it be the fact that: Anyway I am out of here - enjoy your coding. M231 point -
Sending text to an active window in RDP
SOLVE-SMART reacted to argumentum for a topic
The clear way to understand this would be: Treat the RDP screen as a BMP graphic. There is no "access to the controls of the remote as controls", but as an image. If you wanna do something on the remote session like "access to the controls of the remote as controls", you'll have to run from within that PC/session. There is no way around that, that I have ever seen, anywhere. I hope this post save you time into looking for a way to get it done, as there is none.1 point -
Another way, if you want or need to run 32-bit is to turn off file system redirection. #include <WinAPIFiles.au3> ;Turn off redirection for a 32-bit script on 64-bit system. If @OSArch = "X64" And Not @AutoItX64 Then _WinAPI_Wow64EnableWow64FsRedirection(False) Global $sFile = "C:\WINDOWS\system32\SnippingTool.exe" If FileExists($sFile) Then Run($sFile) Else MsgBox(0,'File Error', "The Windows snipping tool was not found") EndIf Adam1 point
-
A simple endless kaleidoscope made on a RichEdit control (hit esc to exit) Idea is from this link: http://www.calormen.com/jsbasic/ select the "Rod's Color Pattern" demo and run it on the Apple 2 emulator on that web page to see the original Apple II version. ; Idea from this link: http://www.calormen.com/jsbasic/ ; get the "Rod's Color Pattern" from the "Select a sample..." combo and run it ; #include <GuiRichEdit.au3> #include <GUIConstants.au3> HotKeySet("{ESC}", "_TheEnd") ; Global $iHwidth = 40, $iVheight = 40; width and height of screen Global $sBuffer = _StringReplay(_StringReplay(" ", $iHwidth + 1) & @CRLF, $iVheight) ;to fill the RichEdit Global $sChar = " " Global Const $aApplesoft_color[16] = [ _ ; LoRes colors in Applesoft basic 0x000000, _ ; 0x0 = 00 = Black 0XFF00FF, _ ; 0x1 = 01 = Magenta 0X0000A0, _ ; 0x2 = 02 = Dark Blue 0X800080, _ ; 0x3 = 03 = Purple 0X006400, _ ; 0x4 = 04 = Dark Green 0X808080, _ ; 0x5 = 05 = Grey 0X0000CD, _ ; 0x6 = 06 = Medium Blue 0XADD8E6, _ ; 0x7 = 07 = Light Blue 0XA52A2A, _ ; 0x8 = 08 = Brown 0XFFA500, _ ; 0x9 = 09 = Orange 0XD3D3D3, _ ; 0xA = 10 = Light Grey 0XFFC0CB, _ ; 0xB = 11 = Pink 0X008000, _ ; 0xC = 12 = Green 0XFFFF00, _ ; 0xD = 13 = Yellow 0X00FFFF, _ ; 0xE = 14 = Aqua 0xFFFFFF]; ; 0xF = 15 = White Global $MyGui = GUICreate("", 335, 630, -1, -1, $WS_POPUPWINDOW, BitOR($WS_EX_DLGMODALFRAME, $WS_EX_CLIENTEDGE, $WS_EX_COMPOSITED, $WS_EX_LAYERED)) $hGlass = GUICtrlCreateLabel("", 0, 0, 335, 630, -1, $GUI_WS_EX_PARENTDRAG) ; Protect the RichEdit and allows to drag the GUI around GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) ; This is like a glass over the underlying RichEdit GUICtrlSetCursor(-1, 2) ; Cursor is an arrow (instead of the default I-beam) ; ; This RichEdit is used to simulate the LoRes Graphic of tha Apple 2 (40x40 pixels) Global $hGR = _GUICtrlRichEdit_Create($MyGui, $sBuffer, 0, 0, 335, 630, BitOR($ES_READONLY, $ES_MULTILINE)) _GUICtrlRichEdit_SetSel($hGR, 0, -1) _GUICtrlRichEdit_SetFont($hGR, 10, "Courier new") _GUICtrlRichEdit_SetBkColor($hGR, 0xffffff) GUISetState() ; Main loop ; --------- While 1 For $W = 3 To 50 For $x = 19 To 1 Step -1 For $y = 19 To 0 Step -1 $xy = $x + $y $iColor = Mod(Int($y * 3 / ($x + 3) + $x * $W / 12), 16) $sChar = ChrW(32 + $iColor) ; comment this if you don't want chars (only color) If $iColor > 15 Then $iColor = 15 Print($sChar, $x, $xy, $iColor) Print($sChar, $xy, $x, $iColor) Print($sChar, 40 - $x, 40 - $xy, $iColor) Print($sChar, 40 - $xy, 40 - $x, $iColor) Print($sChar, $xy, 40 - $x, $iColor) Print($sChar, 40 - $x, $xy, $iColor) Print($sChar, $x, 40 - $xy, $iColor) Print($sChar, 40 - $xy, $x, $iColor) Next Next Next WEnd ; Print a char to Htab (Horiz. pos), Vtab (Vert pos) on the RichEdit ; ------------------------------------------------------------------ Func Print($sChar = "", $iHtab = 1, $iVtab = 1, $iColor = 0xffffff) _GUICtrlRichEdit_SetSel($hGR, GetAbsPos($iHtab, $iVtab), GetAbsPos($iHtab, $iVtab) + 1, True) _GUICtrlRichEdit_SetCharBkColor($hGR, $aApplesoft_color[$iColor]) _GUICtrlRichEdit_ReplaceText($hGR, $sChar, False) EndFunc ;==>Print ; From Htab Vtab (1 based) to Absolute position within the RichEdit ; ----------------------------------------------------------------- Func GetAbsPos($iHtab = 1, $iVtab = 1, $iScreenWidth = $iHwidth) Return ($iVtab - 1) * ($iScreenWidth + 2) + $iHtab EndFunc ;==>GetAbsPos ; returns one or more chars replicated n times ; Example: ConsoleWrite(_StringReplay('*', 5) & @CRLF) Func _StringReplay($sChars = "", $iRepeats = 0) $sChars = String($sChars) $iRepeats = Int(Abs(Number($iRepeats))) Return StringReplace(StringFormat('%' & $iRepeats & 's', ""), " ", $sChars) EndFunc ;==>_StringReplay Func _TheEnd() If WinActive("[ACTIVE]") = $MyGui Then _GUICtrlRichEdit_Destroy($hGR) Exit EndIf EndFunc ;==>_TheEnd1 point