Leaderboard
Popular Content
Showing content with the highest reputation on 02/04/2021 in all areas
-
Hi guys, All works fine 🙂 The reason is just a matter of telling the application where to look for the DLL. Solution : I found the it here : https://www.codeproject.com/Tips/5287858/WebView2-Edge-Browser-in-MFC-Cplusplus-Application What to do, if Build is successful and when you run, it fails. Open the project in the file system, there is one debug folder (which is created once the build is successful). In the debug folder, there are three different folders - arm64, x64, x86 and each one contains the file "WebView2Loader.dll". So based on your environment, copy the "WebView2Loader.dll" file and paste where your .exe is located. Root cause : When you run the script in SciTE, it does not find the DLL because it is ran from the AutoIT folder... When you compile the script and put is in the .EXE same folder as the DLL all runs fine ... Check : Once you have ran it, it will create a new folder and a bunch of sub folders and files : Main Folder is called : WebView2.exe.WebView2 Great job LarsJ 👌3 points
-
Version 2021.8.30.2
10,243 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 -
WinMerge / Github / StackOverFlow / Track - AutoIt Syntax Highlighting
argumentum reacted to mLipok for a topic
For anyone interested: https://github.com/WinMerge/winmerge/releases/tag/v2.16.10 You can also take a look here: https://github.com/WinMerge/winmerge/issues/446 Download link: https://winmerge.org/downloads/?lang=en I wish you many benefits from this change. Keep calm and healthy. Regards, mLipok1 point -
15-03-2021 Installer, SciTE, Tidy & au3stripper are all recompiled with the latest updates for PellesC/Visual Studio & NSIS to get rid of the false positives, and are now uploaded. 16-03-2021 uploaded the "Final" release candidate v21.316.1639.0 which will be move to production when there aren't any real issues in it.For those that downloaded the AV fixed installer uploaded yesterday evening: Make sure you reinstall with this one as that version created a wrong "SCITE_USERHOME" environment settings as the new NSIS used the "%ProgramData%" variable in stead of the "%LocalAppData%" variable! 4/02/2021: Uploaded a release candidate of the new SciTe4AutoIt3.exe installer. It has been over a year since the last update of the full SciTE4AutoIt3 installer which mainly had to do with the fact that Neil was moving toward v5 of SciTE and there weren't many functional changes in SciTE v4 other than to support the different setup of the Lexers to be used in V5. The included SciTE version is now v4.4.6 and the VC15 build was changed from "Win sdk 7 & Toolset v141_xp" to "Win sdk 8.1 & Toolset v141", So I am not sure if it will still run on the older WinXP version. The upcoming V5 version of SciTE will likely drop WinXP altogether. This v4.4.6 version wasn't available before so still needs proper testing for a couple of days to ensure everything works before I release it. Any help with testing this version before general release is appreciated. Also any feedback is welcome in case I missed something or suggestions for improvement before releasing. ==> SciTE4AutoIt3 v21.203.1500.1 UPDATE 4/02/2021: Changed back to "Win sdk 7 & Toolset v141_xp" to maintain WinXP compatibility for SciTE& Scilexer.dll Updates SciTE source to support v141_xp toolset. added check in NSIS installer to check for msvcp140.dll and point to Microsoft Downloads to install vc_redist.x86.exe or else SciTE won't run. UPDATE 6/02/2021: Restored fix for avoiding locking directory. Few other minor fixes in properties files. UPDATE 7/02/2021: AutoIt3Wrapper v19.1127.1402.28 Fixed regression creating duplicate resource entries. Enjoy, Jos -------------------------------------------------------------------------------------------------- 02-??-2021 *** Merged the SciTE v 4.4.6 by Neil Hodgson with our own version of SciTE. (Jos) - Change the workdir to the programdir to avoid locking up the last opened scriptfile directory. - Fixed Bom checking bug resulting to garbage characters in the editor for UTF encoded file other than UTF8 - Dropped support for WinXP (Compiled with vc15, Win sdk 8.1, Toolset v141) - Compiled with vc15 and changed SSE instruction set to ia86 compatible. *** Updated AutoIt3Wrapper v19.1127.1402.0 (Jos) - 19.1127.1402.1 added clear errors when Tidy is ran with Ctrl+T. - 19.1127.1402.2 Avoid running Tidy for a second time when script needs to be run with #RequireAdmin in elevated mode. - 19.1127.1402.5 Added work-around to support Unicode characters in filenames for: - au3check - Tidy - au3stripper - 19.1127.1402.6 Added Win10 build to info lines. (tnx argumentum) - 19.1127.1402.7 Fix for support of filenames containing special ascii characters too. - 19.1127.1402.8 Restored some Directives still used for versioning and fileversion. - 19.1127.1402.8 Fix for support of filenames containing special ascii characters too. - 19.1127.1402.9 Fix checking for "#AutoIt3Wrapper_Version"check till after the GUI is done. - 19.1127.1402.10 Fixed Versionupdate with /RunAfter option I use for AutoIt3Wrapper updates. - 19.1127.1402.11 Fixed issue with #include statements where the filename is enclosed in single quotes. - 19.1127.1402.13 Updated File prompt. - 19.1127.1402.18 added include filelist and their encoding when /debug is supplied - 19.1127.1402.19 Cosmetic update showing the ">Setting Program ExecutionLevel Manifest information to...." only when the directive is provided - 19.1127.1402.20 Fix for elevated scripts running from mapped drive - 19.1127.1402.21 again Fix for support of filenames containing special ascii characters. - 19.1127.1402.22 Fix invalid FileExist statement on line 550. - 19.1127.1402.26 Added #AutoIt3Wrapper_Res_Fileversion_Use_Template *** Updated Au3Stripper v19.1127.1402.0 (Jos) - 19.1127.1402.1 Option /rsln: Added replace for @ScriptLinenumber for #includes to contain source files and original linenumber. - Changed replace for @ScriptLinenumber to only replace none literal string occurrences. - 19.1127.1402.3 Changed replace for @ScriptLinenumber to only replace when not on FUNC line. - 19.1127.1402.5 Added directive "#Au3Stripper_Ignore_Errors_in_Func=", which will suppress any errors triggered within the defined Functions. - 19.1127.1402.7 Fix for Func names in FUNC parameters to avoid stripping the target function. *** Updated SciTEConfig v19.1127.1402.0 (Jos) - 19.1127.1402.1 - Fix bug in AbbrevMan.au3 when pipe symbol is used to set cursor position. (Melba23 *** Updated Tidy v19.1127.1402.0 (Jos) - v19.1127.1402.2 fixed some issues in the /gendoc option: - func reference lines weren't listed - only show variables starting with $ or @ - v19.1127.1402.5 Default Tabsize to SciTE-TabSize when not provided. - v19.1127.1402.6 Made the backp sequence number 2 digits. old filenames will be converted. - v19.1127.1402.10 Reversed the 2 digit sequence number as this will fail when there are more than 99 backup versions. --------------------------------------------------------------------------------------------------1 point
-
Why is a window not activated by a partial title?
Earthshine reacted to Nine for a topic
Are you playing with the handles of your....coffin ?1 point -
Creating a "brushed up" Task Scheduler UDF?
FrancescoDiMuro reacted to water for a topic
Nothing new. Just modified the text a bit. Seems the forum reports a new version even when there was no file upload1 point -
same as @ptrex ..... I tried it on 3 different computers even after installing "WebView2 Runtime: Evergreen Bootstrapper" but still nothing. There is some detail that escapes us. Are there any other "beta testers" who have tried this? p.s. ..... Come on, @LarsJ and @mLipok, what other secret setting did you use !!?? .....1 point
-
@mLipok Ha, you noticed. Yes, your guess is right1 point
-
Here is a fix for that: AutoItAbbrevExpand.lua AddEventHandler("OnChar", function(c) if IsLexer(SCLEX_AU3) then local style = editor.StyleAt[editor.CurrentPos - 2] if (style == SCE_AU3_EXPAND) and (c == " ") then editor:DeleteBack() local word = GetCurrentWord() editor.SelectionStart = editor.CurrentPos - #word editor:ReplaceSel(word:lower()) scite.MenuCommand(IDM_ABBREV) end end end) This works only if we use Space key to expand of course, i use only this method. It can be adapted to Ctrl+B as well i think, but this one is enough for me.1 point
-
Getting started example step 3: WebView window First AutoIt implementation. Tested on Windows 10/7, 32/64 bit. Execute WebView2.au3: #AutoIt3Wrapper_Au3Check_Parameters=-d -w- 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_UseX64=y Opt( "MustDeclareVars", 1 ) #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPICom.au3> #include <WinAPI.au3> Global $hGui, $oCoreWebView2Environment, $oCoreWebView2Controller #include "..\Includes\WV2Interfaces.au3" WebView2() Func WebView2() $hGui = GUICreate( "WebView2 Sample", 1200, 900, -1, -1, $WS_OVERLAPPEDWINDOW ) _WinAPI_CoInitialize( $COINIT_APARTMENTTHREADED ) CoreWebView2CreateCoreWebView2EnvironmentCompletedHandlerCreate() ConsoleWrite( "$pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler = " & $pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler & @CRLF & @CRLF ) CoreWebView2CreateCoreWebView2ControllerCompletedHandlerCreate() ConsoleWrite( "$pCoreWebView2CreateCoreWebView2ControllerCompletedHandler = " & $pCoreWebView2CreateCoreWebView2ControllerCompletedHandler & @CRLF & @CRLF ) Local $hWebView2Loader = DllOpen( @AutoItX64 ? "WebView2Loader-x64.dll" : "WebView2Loader-x86.dll" ) Local $aRet = DllCall( $hWebView2Loader, "long", "CreateCoreWebView2EnvironmentWithOptions", "wstr", "", "wstr", "", _ "ptr", NULL, "ptr", $pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler ) If @error Or $aRet[0] Then Return ConsoleWrite( "CreateCoreWebView2EnvironmentWithOptions ERR" & @CRLF ) ConsoleWrite( "CreateCoreWebView2EnvironmentWithOptions OK" & @CRLF & @CRLF ) GUISetState( @SW_SHOW ) While 1 Switch GUIGetMsg() Case $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESIZED Local $tRect = _WinAPI_GetClientRect( $hGui ) $oCoreWebView2Controller.put_Bounds( $tRect ) Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd CoreWebView2CreateCoreWebView2ControllerCompletedHandlerDelete() CoreWebView2CreateCoreWebView2EnvironmentCompletedHandlerDelete() DllClose( $hWebView2Loader ) EndFunc Func CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Invoke( $pSelf, $long, $ptr ) ; Ret: long Par: long;ptr* ConsoleWrite( "CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Invoke" & @CRLF ) $oCoreWebView2Environment = ObjCreateInterface( $ptr, $sIID_ICoreWebView2Environment, $dtag_ICoreWebView2Environment ) ConsoleWrite( "IsObj( $oCoreWebView2Environment ) = " & IsObj( $oCoreWebView2Environment ) & @CRLF & @CRLF ) $oCoreWebView2Environment.CreateCoreWebView2Controller( $hGui, $pCoreWebView2CreateCoreWebView2ControllerCompletedHandler ) Return 0 #forceref $pSelf, $long EndFunc Func CoreWebView2CreateCoreWebView2ControllerCompletedHandler_Invoke( $pSelf, $long, $ptr ) ; Ret: long Par: long;ptr* ConsoleWrite( "CoreWebView2CreateCoreWebView2ControllerCompletedHandler_Invoke" & @CRLF ) $oCoreWebView2Controller = ObjCreateInterface( $ptr, $sIID_ICoreWebView2Controller, $dtag_ICoreWebView2Controller ) ConsoleWrite( "IsObj( $oCoreWebView2Controller ) = " & IsObj( $oCoreWebView2Controller ) & @CRLF ) $oCoreWebView2Controller.AddRef() $oCoreWebView2Controller.get_CoreWebView2( $pCoreWebView2 ) $oCoreWebView2 = ObjCreateInterface( $pCoreWebView2, $sIID_ICoreWebView2, $dtag_ICoreWebView2 ) ConsoleWrite( "IsObj( $oCoreWebView2 ) = " & IsObj( $oCoreWebView2 ) & @CRLF & @CRLF ) Local $tRect = _WinAPI_GetClientRect( $hGui ) $oCoreWebView2Controller.put_Bounds( $tRect ) $oCoreWebView2.Navigate( "https://www.bing.com/" ) Return 0 #forceref $pSelf, $long EndFunc The code is translated to AutoIt from the C++ code in the Getting started example step 3 and from the AutoHotkey code in WebView2.ahk. A slightly updated example is included in WebView2-1.au3 in the 7z-file at bottom of this post.1 point
-
Multiple user created hotkeys
standardUser54 reacted to Nine for a topic
Since all hotkeys must be unique, you could streamline your ini file and (likewise) your code this way : #include <Constants.au3> #include <Array.au3> ;user input here, but initializing random .ini info IniWrite("file.ini", "HotKeys", "a", "fuu") IniWrite("file.ini", "HotKeys", "s", "bar") IniWrite("file.ini", "HotKeys", "d", "hello") Global $aHotKeys = IniReadSection("file.ini", "HotKeys") For $i = 1 to $aHotKeys[0][0] HotKeySet($aHotKeys[$i][0], _Test) Next While Sleep (100) WEnd Func _Test() Local $iInd = _ArraySearch($aHotKeys, @HotKeyPressed, 1, Default, 1, 2, Default, 0) If @error Then Exit MsgBox ($MB_SYSTEMMODAL, "", "Error on hotkey search") ConsoleWrite ($aHotKeys[$iInd][1] & @CRLF) EndFunc1 point -
Datatype from DLLStruct
HurleyShanabarger reacted to jchd for a topic
Here's a way to get byte fundamental datatypes: Local $t = DllStructCreate("byte;char;wchar;short;ushort;int;uint;int64;float;double;ptr;boolean;bool") DllStructSetData($t, 1, 0x3C) DllStructSetData($t, 2, 't') DllStructSetData($t, 3, 'µ') DllStructSetData($t, 4, -12345) DllStructSetData($t, 5, 23456) DllStructSetData($t, 6, -3456789) DllStructSetData($t, 7, 4567890) DllStructSetData($t, 8, 123456789123456) DllStructSetData($t, 9, 123.456789) DllStructSetData($t, 10, 123.4567891234567) DllStructSetData($t, 11, DllStructGetPtr($t)) DllStructSetData($t, 12, True) DllStructSetData($t, 13, True) ConsoleWrite(_VarDump($t) & @LF) It has also been posted another way, using a Windows API but I don't remember which. Use search feature. Yet you can't differentiate a Boolean or a Bool from their byte or int internal representation in the structure. Dump.au31 point -
It took a month of cutting down a big program to find it and here's the code to illustrate "Error allocating memory". The first while using the filename in the fileopen, etc. shows the error. The second while example does not have the problem (so I switched to using it). ;shows "Error allocating memory" ;Autoit v3.3.14.5 #AutoIt3Wrapper_run_debug_mode=Y ; use this to debug in console window <--- LOOK #include <FileConstants.au3> ;--- shows error allocating memory - is it Autoit or SciTE ? Try compiling <-- makes no difference so probably not SciTE. Normally error at index 50K-100K $fnINDEX = @ScriptDir & "\__index.txt" $i = 0 ;#cs While 1 $i = $i + 1 FileOpen($fnINDEX, $FO_OVERWRITE) ;overwrite as we just need last one processed FileWriteLine($fnINDEX, $i) FileClose($fnINDEX) If $i/1000 = Int($i/1000) Then MsgBox(0, "count", "$i = " & $i, 1) ;give indication of count, hangs when memory allocation error imminent WEnd ;#ce ;comment out the above loop and this works without an allocation error - looks like the above code leaking memory? While 1 $i = $i + 1 $fh = FileOpen($fnINDEX, $FO_OVERWRITE) ;overwrite as we just need last one processed FileWriteLine($fh, $i) FileClose($fh) If $i/1000 = Int($i/1000) Then MsgBox(0, "count", "$i = " & $i, 1) ;give indication of count WEnd Exit ;program1 point