Leaderboard
Popular Content
Showing content with the highest reputation on 02/06/2021 in all areas
-
@CarlD Unfortunately, your script does not consider alternate data streams (ADS). Here's the proof: Open the command prompt and enter the following commands: 1.) echo This is a file with valid data>test.txt:valid_data 2.) dir / R test.txt Test.txt is listed as empty file in your script, but it contains 32 bytes. The proof is: 3.) notepad test.txt:valid_data2 points
-
Ok, after searching for easy and functional UDF for works with zip archives, i wrote Zip32 UDF. This UDF used 2 free library zip32.dll and unzip32.dll. Hope this UDF be useful for you. License Main features: Create zip archive Extract zip archive Set archive comment Read archive comment Encrypt archive Decrypt archive Compression level 0-9 Include\Exclude files by date Include\Exclude files by name Include\Exclude files by files number Include\Exclude system and hidden files Update archive Freshen archive Test archive And more... Download Zip32 UDF Included latest zip32.dll and unzip32.dll. Edit: Uploaded UDF on this site zip_udf.zip1 point
-
Thank you @LarsJ for your suggestion I copied the dlls into the autoit path, but again without success, however I think I have found the reason for the problem: 1) after copying the 2 dll to the autoit path, the error kept occurring 2) I tried to set #RequireAdmin on the script and, at this point, the following new error window appeared: "Microsoft Edge cannot read and write to the data directory: C:\ Program Files (x86) \ AutoIt3 \ autoit3_x64.exe.WebView2 \ EBWebView" so the problem is that the AutoIt3 directory doesn't have write permission for local users. That's all. it is not necessary to copy the DLLs to a location other than the script path. my solution has been to set write/modify permissions to the AutoIt3 folder so to allow the script to create its own subfolder (on first run). Once the subfolder was created, I restored the previous permission to the AutoIt3 folder and allowed the write/modify permission only to the newly created autoit3_x64.exe.WebView2 folder This way everything works fine (... so far ...) Thanks again for your tips P.S. @LarsJ This WebView2 script you wrote is elite. I tried to study it and I see that you have for example also used portions of code (Func ObjectFromTag) that I had already seen (with awe) created by the queen of developers @trancexx in this other post. But, now as then I must give up trying to understand. This type of code intimidates me, too complex for my poor understanding of the inner workings of Windows. However I like to see powerful code like this appear on the forum thanks to programmers, like you and many others, who master these intricacies with great ease. Thanks again1 point
-
You can try to copy WebView2Loader-x86.dll and WebView2Loader-x64.dll to the AutoIt installation folder. When you run a program in SciTE with F5 then either AutoIt3.exe or AutoIt3_x64.exe is the running executable. I completely agree with you that it's inappropriate especially during program development that one cannot run the code directly from SciTE. The reason why you cannot run the code from SciTE must probably be found on your own PC. argumentum, mLipok and I can actually run the code from SciTE on our PCs.1 point
-
@Chimp There is nothing special you should do. Everything is in the zip file from Larsj. Extract it, compile the example script an run it. Of course you need to have the runtime libraries installed.1 point
-
Because the array created by WinList has 2 columns (Title & Hwnd). You attempted to place a value (Window state) in a non-existent 3rd column. One way to do what you are trying to do is to add a 3rd column to the array by using ReDim and then add your window states. #include <Array.au3> #include <Process.au3> #include <WinAPIProc.au3> Global $aArray = WinList() ;$aArray[0][0] = Number of windows returned ;$aArray[1][0] = 1st window title ;$aArray[1][1] = 1st window handle (HWND) ReDim $aArray[UBound($aArray)][3] ;Add 3rd column to the WinList array For $i = 1 To $aArray[0][0] $aArray[$i][2] = WinGetState($aArray[$i][1]) Next _ArrayDisplay($aArray, "WinList", "", 0, Default, "Title|Hwnd|State")1 point
-
How to get text in Powershell command prompt ?
Earthshine reacted to JLogan3o13 for a topic
@Zawarujqa I will add on to what @Jos and @Melba23 have said about your attitude, as I think between the two of them now you have been given more than fair warning. Thus far in your 16 posts, you have been simultaneously unable to solve your own issues AND ugly toward those who do have the skill sets you lack. This is not a combination that will gain you any friends on this forum (or anywhere I suspect). And as you've received multiple warnings about your attitude, to no apparent effect, I have placed your account on Moderation preview; for the foreseeable future anything you post will need to be reviewed and approved first. As Melba stated, much more nicely than I would have, you are free to choose one of three paths: Find a way to rein in your attitude toward others when posting, Find another language that better suits you and your complaints of what should be, or continue as you have been and be shown the door.1 point -
How to get text in Powershell command prompt ?
Earthshine reacted to Jos for a topic
The AutoItX.chm is a separate helpfile located in its subdirectory and doesn't have the -1 to -4 option.1 point -
How to get text in Powershell command prompt ?
Earthshine reacted to Zawarujqa for a topic
In any case, it didn't work either way for me. And I've already migrated to System.Diagnostics.1 point -
How to get text in Powershell command prompt ?
Earthshine reacted to Melba23 for a topic
Zawarujqa, Firstly, when you reply in future, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - responders know what they wrote and it just pads the thread unnecessarily. Thanks in advance for your cooperation. Secondly, what you have quoted is indeed from the Help file, so I have no idea what Nine is talking about. However, I have no idea if that functionality is present in the AutoItX command subset as I do not use it myself. Thirdly, your attitude when posting here since your arrival leaves a lot to be desired. Being critical of lacunae in AutoIt is one thing - attacking those volunteers who develop and support AutoIt (in which I number) is quite another. There are many satisfied users of AutoIt - if you are among the minority who do not find it to your liking then please accept our apologies and go in peace to look for another scripting language which better serves your purpose. However, continued posting along the lines of your previous unnecessarily provocative offering may result in you not having a choice in the matter - I hope I make myself clear. M231 point -
How to get text in Powershell command prompt ?
Earthshine reacted to Nine for a topic
LoL - you are not looking at the right chm. I am done with you...1 point -
How to get text in Powershell command prompt ?
Earthshine reacted to Nine for a topic
@Zawarujqa Instead of complaining at this forum and software, why don't you start reading the .chm of AutoItX. The answers to your questions are all very described in there. It is not the software that is sluggish in here. Take a careful look at your programming and learning talents...1 point -
How to get text in Powershell command prompt ?
Earthshine reacted to Jos for a topic
Why don't you simply waste your space and presence somewhere else with that attitude?1 point -
It's not that hard. Here is an example with the context menu in Notepad. Run the code in SciTE with F5. Only tested in Windows 7. Should also work in Windows 10. #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 <Misc.au3> #include <GuiMenu.au3> #include <WindowsConstants.au3> Example() Func Example() ; Open Notepad Run( "notepad.exe" ) WinWait( "[CLASS:Notepad]" ) ; Open context menu Send( "{APPSKEY}" ) WinWait( "[CLASS:#32768]" ) ; Get menu handle Local $hMenu = GetMenuHandle() If Not $hMenu Then Return ConsoleWrite( "$hMenu ERR" & @CRLF ) ConsoleWrite( "$hMenu OK" & @CRLF ) ; Add new menu item Local $iItem = _GUICtrlMenu_AddMenuItem( $hMenu, "My new menu item" ) If Not $iItem Then Return ConsoleWrite( "$iItem ERR" & @CRLF ) ConsoleWrite( "$iItem OK" & @CRLF ) ; Show all menu items Local $iCount = _GUICtrlMenu_GetItemCount( $hMenu ), $sText For $i = 0 To $iCount - 1 $sText = _GUICtrlMenu_GetItemText( $hMenu, $i ) If $sText <> "" Then ConsoleWrite( "$sText = " & $sText & @CRLF ) ConsoleWrite( "$iIndex = " & $i & @CRLF ) EndIf Next ; Detect menu item click While Sleep(10) And Not _IsPressed( "01", "user32.dll" ) WEnd $iItem = _GUICtrlMenu_MenuItemFromPointEx( 0, $hMenu ) ; Works in both 32 and 64 bit code ConsoleWrite( "Clicked item = " & $iItem & @CRLF ) If $iItem <> $iCount - 1 Then Return ConsoleWrite( "My new menu item NOT clicked" & @CRLF ) ConsoleWrite( "My new menu item clicked" & @CRLF ) EndFunc Func GetMenuHandle() Local $hDesktop = _WinAPI_GetDesktopWindow(), $i = 0 Local $hChild = _WinAPI_GetWindow( $hDesktop, $GW_CHILD ) While $hChild And $i < 50 If _WinAPI_GetClassName( $hChild ) = "#32768" Then ExitLoop $hChild = _WinAPI_GetWindow( $hChild, $GW_HWNDNEXT ) $i += 1 WEnd If $i = 50 Then Return 0 Local $hMenu = _SendMessage( $hChild, $MN_GETHMENU ) If $hMenu > 0 Then Return $hMenu Return 0 EndFunc Func _GUICtrlMenu_MenuItemFromPointEx( $hWnd, $hMenu, $iX = -1, $iY = -1 ) If $iX = -1 Then $iX = _WinAPI_GetMousePosX() If $iY = -1 Then $iY = _WinAPI_GetMousePosY() Local $tPOINT = DllStructCreate( "long;long" ) DllStructSetData( $tPOINT, 1, $iX ) DllStructSetData( $tPOINT, 2, $iY ) Local $tPOINT64 = DllStructCreate( "int64", DllStructGetPtr( $tPOINT ) ) Local $aResult = DllCall("user32.dll", "int", "MenuItemFromPoint", "hwnd", $hWnd, "handle", $hMenu, "int64", DllStructGetData( $tPOINT64, 1 ) ) If @error Then Return SetError(@error, @extended, -1) Return $aResult[0] EndFunc SciTE output: $hMenu OK $iItem OK $sText = &Undo $iIndex = 0 $sText = Cu&t $iIndex = 2 $sText = &Copy $iIndex = 3 $sText = &Paste $iIndex = 4 $sText = &Delete $iIndex = 5 $sText = Select &All $iIndex = 7 $sText = &Right to left Reading order $iIndex = 9 $sText = &Show Unicode control characters $iIndex = 10 $sText = &Insert Unicode control character $iIndex = 11 $sText = &Open IME $iIndex = 13 $sText = &Reconversion $iIndex = 14 $sText = My new menu item ; <<<<<<<< $iIndex = 15 Clicked item = 15 My new menu item clicked ; <<<<<<<< Once the new menu item is clicked, you can either execute a menu function directly, or you can open your own context menu with several items and possibly submenus. Both with straightforward AutoIt code.1 point
-
Previously, I used a method of GetDeviceCaps that attempted to read out the DPI of the desktop (96 or otherwise) ... but that kept returning 96 for some monitors when scaling was set to 125% or 150%. (There are multiple references to the DLL call for $Logpixelsy in posts on this forum. But apparently, $Logpixelsy doesn't exists on all systems ... so the call returns 0 ... which is interpreted as 96.) After much research, I've settled on a method that works reliably on several different PCs, with monitors up to 1920 x 1080 pixels: MsgBox(0, "Scaling", _GetDPI_Ratio()) Func _GetDPI_Ratio() Local $hWnd = 0 Local $hDC = DllCall("user32.dll", "long", "GetDC", "long", $hWnd) Local $aRet = DllCall("gdi32.dll", "long", "GetDeviceCaps", "long", $hDC[0], "long", 10) ; = reported vert height (not logical, which is param=90) Local $bRet = DllCall("gdi32.dll", "long", "GetDeviceCaps", "long", $hDC[0], "long", 117) ; = true vert pixels of desktop $hDC = DllCall("user32.dll", "long", "ReleaseDC", "long", $hWnd, "long", $hDC) Return $bRet[0] / $aRet[0] EndFunc For reference, here's a link to a method that uses PowerShell: link It confirms the validity of using the ratio of these two parameters. There's one other aspect to this that I want to mention: In the latest versions of Win10—and on particular PCs—scaling is set to 100% on monitors as large as 1920 x 1080 ... yet the desktop uses medium icons and applications have what I consider to be normal sizes. I haven't been able to determine how certain combinations are able to do this, because some PCs I have access to require 125% scaling on a 1920 monitor for applications to have anything close to normal size. (IOW, at 100%, the desktop appears uncomfortably small.) A table in MSFT's documentation seems to indicate there are certain magic combinations of display sizes versus pixels that can use 100% scaling. table Nevertheless, I'm glad to be able to read out the scaling. But certainly feel free to add to the discussion. I only ask that you cite online sources as supporting references.1 point
-
@jdelaney Good idea here is my variation: #include <Date.au3> LoggingStart("Starting Script") Main() LoggingEnd("Ending Script") Func Main() LoggingStart(Main) Step2() LoggingEnd(Main) EndFunc ;==>Main Func Step2() LoggingStart(Step2) InternalOrInner() LoggingEnd(Step2) EndFunc ;==>Step2 Func InternalOrInner() LoggingStart(InternalOrInner) MsgBox(0, 'Test', @ScriptLineNumber) LoggingEnd(InternalOrInner) EndFunc ;==>InternalOrInner #Region Logging Functions Func LoggingStart($sCallersFuncName) __Logging('Starting', $sCallersFuncName, +1) EndFunc ;==>LoggingStart Func LoggingEnd($sCallersFuncName) __Logging('Ending', $sCallersFuncName, -1) EndFunc ;==>LoggingEnd Func __Logging($sCallersLog, $sCallersFuncName, $iIndentation) Local Static $iIndent_static = 0 If $iIndentation = +1 Then $iIndent_static += $iIndentation If IsFunc($sCallersFuncName) Then $sCallersFuncName = FuncName($sCallersFuncName) $sNow = _Now() ConsoleWrite(StringFormat("%-" & $iIndent_static + StringLen($sNow) + 1 & "s", $sNow) & $sCallersLog & ' > ' & $sCallersFuncName & " < " & @CRLF) If $iIndentation = -1 Then $iIndent_static += $iIndentation EndFunc ;==>__Logging #EndRegion Logging Functions1 point
-
All Local IPV4 Address To Array
GoogleDude reacted to jguinch for a topic
Using a WMI query + a regex : #Include <Array.au3> Local $aIPAddresses = _GetAllIP() _ArrayDisplay($aIPAddresses) Func _GetAllIP() Local $aRet[1] = [0], $iCount = 1, $iNumAddr Local $oWMIService = ObjGet("winmgmts:\\.\root\CIMV2") If Not IsObj($oWMIService) Then Return SetError(1, 0, 0) Local $sQuery = "select * from win32_networkadapterconfiguration where IPEnabled = True" Local $oNetCfgs = $oWMIService.ExecQuery($sQuery, "WQL", 0x10 + 0x20) If NOT IsObj($oNetCfgs) Then Return SetError(1, 0, 0) For $oNetCfg In $oNetCfgs $aIPAddr = $oNetCfg.IPAddress $iNumAddr = UBound($aIPAddr) If UBound($aRet) <= ($iCount + $iNumAddr ) Then Redim $aRet[$iCount * 2 + $iNumAddr] For $i = 0 To $iNumAddr - 1 If Not StringRegExp($aIPAddr[$i], "(?:(?:(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?1))") Then ContinueLoop ; IPv4 adresses only $aRet[$iCount] = $aIPAddr[$i] $iCount += 1 Next Next $aRet[0] = $iCount - 1 Redim $aRet[$iCount] Return $aRet EndFunc1 point -
Discover on which TCP port a specific Windows Process ID is listening
GoogleDude reacted to water for a topic
Please have a look at the written by trancexx. Her script shows Process Name, PID, local/remote IP/port, connection state etc.1 point -
Hey check this new PureAutoItADB UDF. This project is still in beta. Kindly suggest me to improve. Very thanks <snip>0 points