Leaderboard
Popular Content
Showing content with the highest reputation on 08/07/2022 in all areas
-
Curl UDF - libcurl with x64 support
Stormgrade reacted to Beege for a topic
Here is a rewrite of Wards Curl UDF with the binary portion removed so that it can support external (updated) library's and add support for x64. I added quite a few new header constants and also have included the curl-ca-bundle certificate. I modified the first two "easy" examples to demonstrate using the ca-bundle to verify the SSL peer. I also added a new example showing how to download the certificate chain. The 7.82.0 version dlls are included but they can be replaced with updated versions as they come out in the future. You can find future releases here : https://curl.se/windows/ Let me know if you have any issues. Cheers! 🙂 Curlx64.7z1 point -
1 point
-
A simple example, alternatively search Google with the term "AutoIt Copy with Progress bar". #include <File.au3> Global $g_sSource = "C:\temp\folderA" Global $g_sTarget = "C:\temp\folderB" _Example1() Func _Example1() Local $aSource = _FileListToArrayRec($g_sSource, "*", 1, 1, 0, 1) If @error Then Exit MsgBox(4096, "Error", "No Folders/Files found.") Local $iIndex = 100/$aSource[0], $iProgress = $iIndex ProgressOn("Moving", $g_sSource) For $i = 1 To $aSource[0] ProgressSet($iProgress, "..\" & $aSource[$i], "Moving : " & $g_sSource) FileMove($g_sSource & "\" & $aSource[$i], $g_sTarget & "\" & $aSource[$i], 9) $iProgress += $iIndex Next ProgressSet(100, "Done", "Complete") Sleep(5000) EndFunc1 point
-
Display png images
Decibel reacted to pixelsearch for a topic
Hi everybody I would like to thank UEZ for the great help he brought us concerning what follows : When I right click a row in the following ListView, the corresponding image should be displayed in a Splash Window and disappear as soon as the mouse moves. But as you can see below, nothing happens when the image is .png type (as stated in the help file, topics SplashImageOn and GUICtrlCreatePic) Now see how it works fine with jpg, gif or bmp : Gladly UEZ indicated not 1, but 2 different ways to solve this, allowing us to display png files using GDI+ Let's start with way #1, simulating a Splash Window : #include <GDIPlus.au3> #include <WindowsConstants.au3> $sFileName = @ScriptDir & "\Torus.png" If Not FileExists($sFileName) Then _ Exit MsgBox($MB_TOPMOST, "Error", $sFileName & " not found") _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile($sFileName) $iX = _GDIPlus_ImageGetWidth($hImage) $iY = _GDIPlus_ImageGetHeight($hImage) $hGUI = GUICreate("", $iX, $iY, -1, -1, _ $WS_BORDER + $WS_POPUP, $WS_EX_TOPMOST) GUISetState() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 0, 0, $iX, $iY) $aPos_Old = MouseGetPos() Do $aPos_New = MouseGetPos() Sleep(100) Until $aPos_Old[0] <> $aPos_New[0] Or $aPos_Old[1] <> $aPos_New[1] GUIDelete($hGUI) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() Now the 2nd way, displaying the png image in a GUI picture control : #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> $sFileName = @ScriptDir & "\Torus.png" If Not FileExists($sFileName) Then _ Exit MsgBox($MB_TOPMOST, "Error", $sFileName & " not found") _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile($sFileName) $iX = _GDIPlus_ImageGetWidth($hImage) $iY = _GDIPlus_ImageGetHeight($hImage) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $hGUI = GUICreate("Display PNG Image in picture control", $iX, $iY, -1, -1, _ -1, $WS_EX_TOPMOST) $idPic = GUICtrlCreatePic("", 0, 0, $iX, $iY) GUICtrlSendMsg($idPic, 0x0172, 0, $hBitmap) ; STM_SETIMAGE = 0x0172, $IMAGE_BITMAP = 0 GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete($hGUI) _WinAPI_DeleteObject($hBitmap) _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() Exit Case $idPic MsgBox($MB_TOPMOST, "Information", "PNG image was clicked") EndSwitch WEnd The "Torus.png" image can be downloaded just below in case you want to try the scripts. Just rename it "Torus.png" and place it in the same folder than the scripts. @UEZ : and let's hope this will be useful for those who encountered the same issue. @Mods : I didn't know where to post this comment. If you think it should be placed in another part of the Forum, please be kind enough to move it there, thanks. Torus.png1 point -
I built my own libcurl for AutoIt based on BinaryCall UDF. libcurl - the multiprotocol file transfer library The Features: Pure AutoIt script, no DLLs needed.Build with SSL/TLS and zlib support (without libidn, libiconv, libssh2).Full easy-interface and partial multi-interface support.Data can read from or write to autoit variables or files.Smaller code size (compare to most libcurl DLL).The version information of this build: Curl Version: libcurl/7.42.1SSL Version: mbedTLS/1.3.10Libz Version: 1.2.8Protocols: ftp,ftps,http,httpsHere are the helper functions (not include in libcurl library). Curl_DataWriteCallback()Curl_DataReadCallback()Curl_FileWriteCallback()Curl_FileReadCallback()Curl_Data_Put()Curl_Data_Get()Curl_Data_Cleanup()See the example script for detail usage. Curl.zip1 point
-
Getting tooltip text from a Chromium based browser
pixelsearch reacted to Nine for a topic
Here to start you up (couldn't help trying it) #include <Constants.au3> #include "Includes\CUIAutomation2.au3" Opt("MustDeclareVars", 1) Example() Func Example() ; Create UI Automation object Local $oUIAutomation = ObjCreateInterface($sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation) If Not IsObj($oUIAutomation) Then Return ConsoleWrite("$oUIAutomation ERR" & @CRLF) ConsoleWrite("$oUIAutomation OK" & @CRLF) ; Get Desktop element Local $pDesktop, $oDesktop $oUIAutomation.GetRootElement($pDesktop) $oDesktop = ObjCreateInterface($pDesktop, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) If Not IsObj($oDesktop) Then Return ConsoleWrite("$oDesktop ERR" & @CRLF) ConsoleWrite("$oDesktop OK" & @CRLF) ; --- Find Chrome window --- Local $pCondition $oUIAutomation.CreatePropertyCondition($UIA_ClassNamePropertyId, "Chrome_WidgetWin_1", $pCondition) If Not $pCondition Then Return ConsoleWrite("$pCondition ERR" & @CRLF) ConsoleWrite("$pCondition OK" & @CRLF) Local $pChrome, $oChrome $oDesktop.FindFirst($TreeScope_Descendants, $pCondition, $pChrome) $oChrome = ObjCreateInterface($pChrome, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) If Not IsObj($oChrome) Then Return ConsoleWrite("$oChrome ERR" & @CRLF) ConsoleWrite("$oChrome OK" & @CRLF) ; --- Find Tooltip element --- $oUIAutomation.CreatePropertyCondition($UIA_ClassNamePropertyId, "tooltips_class32", $pCondition) If Not $pCondition Then Return ConsoleWrite("$pCondition ERR" & @CRLF) ConsoleWrite("$pCondition OK" & @CRLF) Local $pTooltip, $oTooltip While True $oDesktop.FindFirst($TreeScope_Descendants, $pCondition, $pTooltip) $oTooltip = ObjCreateInterface($pTooltip, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) If IsObj($oTooltip) Then ExitLoop WEnd ConsoleWrite ("Found tooltip" & @CRLF) Local $sText $oTooltip.GetCurrentPropertyValue($UIA_NamePropertyId, $sText) ; $UIA_NamePropertyId extracts the text MsgBox ($MB_SYSTEMMODAL,"",$sText) EndFunc Works perfectly on Win7. Cannot test it on Win10, I do not have Chrome. I'll see if I have time to test it on Win10/Edge later...1 point -
@Wisok, It seems you like to "push buttons" in a pretty unpleasant way and while at it insult us, so let me be strait and clear: This was your last post here for the coming 5 days during which period you can consider to either staying away or retuning to our forums and respecting our wishes. Jos0 points
-
Wisok, Thank you for your explanation of the OP's intentions, but I would prefer to hear his own version. And when the Mod team says "keep out", please respect their wishes in future. M230 points