Leaderboard
Popular Content
Showing content with the highest reputation on 01/02/2025 in all areas
-
I indeed see the same on the current Beta happening, but started to work on an update for the "indent fix" logic, and that version is not having this symptom anymore. So guess you will have to wait a bit till I am feeling the urge to finish that, and an update is published.2 points
-
I need from from time to time to run small processes to perform task that would otherwise clog the main process. Yes, there is a number of other UDF that could have done it very well, but I felt they were an over-kill for what I wanted. Don't throw me stones, I know it's not really multi-threading, but it is as close as I could get with simple AutoIt. If someone wonders why I called it PMT, the P stands for Pretending. And I'm also not pretending it is an elaborate UDF. Just small and simple to use... Version 2025-01-03 * changed how temporary files are deleted * changed location of temporary files to use standard folder * added support to unusual location of AutoIt Version 2025-01-02 * corrected bug when temporary files has space within their name. Version 2024-03-24 * corrected bug when 8 parameters (max) is passed to the function Example : #AutoIt3Wrapper_Res_SaveSource=y #include "PMT-UDF.AU3" #include <Constants.au3> _PMT_Init() Local $hProc1 = _PMT_Start("Test1", Default, "Test 1") _PMT_Start("Test2") _PMT_Start("Test3", 5) Local $sResponse While Sleep(50) $sResponse = _PMT_GetResponse($hProc1) If @error Then Exit MsgBox($MB_OK, "Error", "Process has dropped") If $sResponse <> "" Then MsgBox($MB_OK, "Success", $sResponse & @CRLF) ExitLoop EndIf WEnd Func Test1($sTitle, $sMessage) Local $iResp = MsgBox($MB_OK, $sTitle, $sMessage) Return "Done with value " & $iResp EndFunc Func Test2() MsgBox($MB_OK, "2", "Test 2") EndFunc Func Test3($iTimeout) MsgBox($MB_OK, "3", "Test 3", $iTimeout) EndFunc You can pass up to 8 parameters to _PMT_Start. It is up to you to manage the right number. You cannot pass structures, maps or arrays as parameter (only bool, ptr, hWnd, int, float, string, and the keyword Default). You could use my WCD-IPC if need be to exchange large amount of data. If you want to run it compiled, you need to have add #AutoIt3Wrapper_Res_SaveSource=y at the start of your script. In the case you decide to compile your script, _PMT_Init allows you to identity where AutoIt3 is located (in the situation where AutoIt is not installed in the usual directory) to get the right includes in your "threads". Let me know if you have any question, or suggestion, I will be glad to hear them. Enjoy. PMT-UDF.au31 point
-
RustDesk UDF
argumentum reacted to BinaryBrother for a topic
I'm taking your advice, and maintaining, but I don't have the time to de-customize every aspect. Uploads on main post: Updated. Removed in-post static code.1 point -
UDF : Multi-threading made easy
Nine reacted to pixelsearch for a topic
@Nine Hellooo ! I just tested your PMT UDF with the example provided, but I got 2 issues. The 1st one comes from this line : Local $iPID = Run(@AutoItExe & " /AutoIt3ExecuteScript " & $sFile, "", Default, $STDOUT_CHILD) How can it work if there is at least 1 space in $sFile ? These are my 3 tests : ; Local $sFile = _TempFile(@ScriptDir, "~~", ".au3", 12) ; won't work for me as plenty of spaces in path ; Local $sFile = _TempFile("F:\Temp space\", "~~", ".au3", 12) ; won't work for me as 1 space in path Local $sFile = _TempFile("F:\", "~~", ".au3", 12) ; ok For example, with the 2nd test, e.g. when "F:\Temp space\" is used : Do you have the same issue or is it just me ? Thanks1 point -
_ArrayUnique on multiple columns
WildByDesign reacted to Gianni for a topic
Hi @WildByDesign Thanks for the kind words, ... glad I could help ..1 point -
WinActiveBorder()
Danyfirex reacted to argumentum for a topic
1 point -
PixelCheckSum working on PC, but not on laptop.
pixelsearch reacted to ioa747 for a topic
I can only speculate. They have the same resolution and the same scale layout?1 point -
Display png images
cramaboule reacted to Shark007 for a topic
1st things 1st, @UEZ, Thank you for sharing your knowledge. To follow up on @pixelsearch information, I present a simple GUI that uses #AutoIt3Wrapper_Res_HiDpi=Y. #NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=Y #AutoIt3Wrapper_Res_HiDpi=Y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GDIPlus.au3> _GDIPlus_Startup() Global $iScale = DllCall($__g_hGDIPDll, "int", "GdipGetDpiX", "handle", _GDIPlus_GraphicsCreateFromHWND(0), "float*", 0)[2] / 96 ; The above line retrieves the current Windows Scaling Factor - If Windows is set to 150% scaling it will return 1.5 GUICreate('Test', 500 * $iScale, 300 * $iScale, 200 * $iScale, 400 * $iScale) ;Create a GUI GUICtrlCreateButton("DPI testing", 350 * $iScale, 50 * $iScale, 120 * $iScale, 20 * $iScale) ; Create s button Global $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Torus.png") ;The PNG image that you want to display Global $B_Scaled = _GDIPlus_ImageScale($hImage, $iScale, $iScale) ;Torus.png is distributed with AutoIt and is found here - C:\Program Files (x86)\AutoIt3\Examples\GUI Global $idPic = GUICtrlCreatePic("", 150 * $iScale, 75 * $iScale, _GDIPlus_ImageGetWidth($B_Scaled), _GDIPlus_ImageGetHeight($B_Scaled)) ;The above line 1st sets the left/Top coordinates to place the png and then gets scaled image dimensioms for W/H GUICtrlSendMsg($idPic, 0x0172, 0, _GDIPlus_BitmapCreateHBITMAPFromBitmap($B_Scaled)) ; Send the image to the Pic Control _WinAPI_DeleteObject($hImage) ;some clean up _GDIPlus_ImageDispose($B_Scaled) _GDIPlus_Shutdown() GUISetState(@SW_SHOW, 0) While 1 Sleep(50) Switch GUIGetMsg() Case -3 Exit EndSwitch WEnd Using the above scaling for your GUI will present the same GUI no matter if the Windows scaling is set to 100% or 350% The absolute real bonus of using HiDpi=Y is the quality of the text within your GUI when it is scaled properly. The text scaling is provided by Windows when the user selects to use HiDpi through the AutoIt3Wrapper.1 point -
The example sets the search folder to C:\Windows\System32 and searches for files and folders with "com" in the name. Windows Explorer must be open before you run the example. 8) PerformSearch.au3 #include "Includes\AutomatingWindowsExplorer.au3" #include "Includes\CUIAutomation2.au3" #include <WinAPIShellEx.au3> #include <Array.au3> Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Windows Explorer on XP, Vista, 7, 8 Local $hExplorer = WinGetHandle( "[REGEXPCLASS:^(Cabinet|Explore)WClass$]" ) If Not $hExplorer Then MsgBox( 0, "Automating Windows Explorer", "Could not find Windows Explorer. Terminating." ) Return EndIf ; Get an IShellBrowser interface GetIShellBrowser( $hExplorer ) If Not IsObj( $oIShellBrowser ) Then MsgBox( 0, "Automating Windows Explorer", "Could not get an IShellBrowser interface. Terminating." ) Return EndIf ; --- Set search folder --- ; Get interfaces GetShellInterfaces() ; Set current folder, C:\Windows\System32 Local $pFolder = _WinAPI_ShellILCreateFromPath( "C:\Windows\System32" ) SetCurrentFolder( $pFolder, $SBSP_ABSOLUTE ) ; Free memory _WinAPI_CoTaskMemFree( $pFolder ) ; --- Start a search --- ; Automation object Local $oUIAutomation = ObjCreateInterface( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation ) If Not IsObj( $oUIAutomation ) Then Return ConsoleWrite( "$oUIAutomation ERR" & @CRLF ) ConsoleWrite( "$oUIAutomation OK" & @CRLF ) ; Explorer object Local $pExplorer, $oExplorer $oUIAutomation.ElementFromHandle( $hExplorer, $pExplorer ) $oExplorer = ObjCreateInterface( $pExplorer, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) If Not IsObj( $oExplorer ) Then Return ConsoleWrite( "$oExplorer ERR" & @CRLF ) ConsoleWrite( "$oExplorer OK" & @CRLF ) ; Find condition Local $pCondition ; Use Inspect.exe (Inspect Objects) to verify that the search box is an Edit control $oUIAutomation.CreatePropertyCondition( $UIA_ControlTypePropertyId, $UIA_EditControlTypeId, $pCondition ) If Not $pCondition Then Return ConsoleWrite( "$pCondition ERR" & @CRLF ) ConsoleWrite( "$pCondition OK" & @CRLF ) ; Find Edit Local $pEdit, $oEdit ; This is the first Edit control $oExplorer.FindFirst( $TreeScope_Descendants, $pCondition, $pEdit ) $oEdit = ObjCreateInterface( $pEdit, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) If Not IsObj( $oEdit ) Then Exit ConsoleWrite( "$oEdit ERR" & @CRLF ) ConsoleWrite( "$oEdit OK" & @CRLF ) ; Get Edit Value object Local $pEditValue, $oEditValue $oEdit.GetCurrentPattern( $UIA_ValuePatternId, $pEditValue ) $oEditValue = ObjCreateInterface( $pEditValue, $sIID_IUIAutomationValuePattern, $dtagIUIAutomationValuePattern ) If Not IsObj( $oEditValue ) Then Exit ConsoleWrite( "$oEditValue ERR" & @CRLF ) ConsoleWrite( "$oEditValue OK" & @CRLF ) ; Set search text, com $oEditValue.SetValue( "com" ) ; Wait a second Sleep( 1000 ) ; --- Get search results --- ; Get interfaces (for Search Results right pane window) GetShellInterfaces() ; Wait while the search is performed Local $iCount = 0, $iCountPrev = -1 While $iCount <> $iCountPrev Sleep( 1000 ) ; Wait a second in each loop $iCountPrev = $iCount $iCount = CountItems() WEnd ; Get search results Local $aItems = GetItems( False, True ) ; $fSelected, $fFullPath _ArrayDisplay( $aItems, "Search Results" ) EndFunc The zip contains the example and all include files: Example8.7z I've tested the new example on Windows 10 and 7. It does not work on Windows XP. I've tested the old examples in post 7 on Windows 10. They are all working.1 point
-
String Regular Expression Tester V2
hudsonhock reacted to Szhlopp for a topic
Since there are WAY to many posts on how to SRE something I thought I would create a nice little tester. This thing does SRE and SRER. Loads files to test. Gets internet content to test. And more! Here it is: SRETesterV2.1.au3 Prev DL - 211 Enjoy!1 point