Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/08/2023 in all areas

  1. Right-mouse-click the helpfile then there should be an option to allow the content?
    1 point
  2. ...I just now download it without any problems. Edit: you may need to try with another browser or "safety" settings.
    1 point
  3. Just made a few changes to the SciTE4AutoIt3 helpfile TOC to show both SciTE & Scintilla Documentation and History pages.
    1 point
  4. 1 point
  5. As promised, I return to let you know that the results of my tests indicate that I indeed have to check for errors on each line to entirely get rid of the subscript errors, as hinted earlier as well in the post I'll mark as solution (yes, I know there are some redundancies in the code, but they are intentional). Even a single If encompassing multiple WinGet... assignments is not enough since the amount of work done inside it has an impact on the errors occurrence. That being said, it's not that bad, since apparently using If IsHWnd(...) Then ... is much more resource friendly than having If @error Then ContinueLoop after each line (the former has the same CPU usage whether the data retrieval interval is 25 ms or 1000 ms, while the latter naturally takes more CPU when on 25 ms): #NoTrayIcon #include <WinAPI.au3> #include <SendMessage.au3> Func SendBang($Bang) Local Const $hWnd = WinGetHandle("[CLASS:RainmeterMeterWindow]") If $hWnd Then Local Const $iLen = StringLen($Bang) + 1 Local Const $pMem = DllStructCreate("wchar[" & $iLen & "]") Local Const $pCds = DllStructCreate("dword;dword;ptr") Local Const $WM_COPYDATA = 0x004A DllStructSetData($pMem, 1, $Bang) DllStructSetData($pCds, 1, 1) DllStructSetData($pCds, 2, ($iLen * 2)) DllStructSetData($pCds, 3, DllStructGetPtr($pMem)) _SendMessage($hWnd, $WM_COPYDATA, 0, DllStructGetPtr($pCds)) EndIf EndFunc Func GetResult() Local $aAct = $CmdLine[1], $aSep = $CmdLine[2], $aInt = $CmdLine[3] Do Local $sOut = "", $pMap[], $pLis = ProcessList(), $wLis = WinList() For $j = 1 to $pLis[0][0] $pMap[$pLis[$j][1]] = $pLis[$j][0] Next For $i = 1 To $wLis[0][0] Local $hWnd = $wLis[$i][1], $pNum = -1, $pNam = -1, $wSty = -1, $wSet = -1, $wTit = -1, $wHan = -1, $wCla = -1, $wSta = -1, $wPos = -1, $wPro = -1 If IsHWnd($hWnd) Then Dim $wHan = WinGetHandle($hWnd) If IsHWnd($wHan) Then Dim $wTit = WinGetTitle($wHan) If IsHWnd($wHan) Then Dim $wCla = _WinAPI_GetClassName($wHan) If IsHWnd($wHan) Then Dim $wSty = WinGetState($wHan), $wSta = BitAND($wSty,1)/1 & @TAB & BitAND($wSty,2)/2 & @TAB & BitAND($wSty,4)/4 & @TAB & BitAND($wSty,8)/8 & @TAB & BitAND($wSty,16)/16 & @TAB & BitAND($wSty,32)/32 If IsHWnd($wHan) Then Dim $wSet = WinGetPos($wHan), $wPos = $wSet[0] & @TAB & $wSet[1] & @TAB & $wSet[2] & @TAB & $wSet[3] If IsHWnd($wHan) Then Dim $pNum = WinGetProcess($wHan), $pNam = $pMap[$pNum], $wPro = $pNum & @TAB & $pNam If IsHWnd($WHan) Then $sOut &= StringSplit($sOut, $aSep, 1)[0] & @TAB & $wTit & @TAB & $wCla & @TAB & $wHan & @TAB & $wSta & @TAB & $wPos & @TAB & $wPro & @TAB & $aSep Next SendBang(StringReplace($aAct, "$Output", $sOut)) Sleep($aInt) Until $aInt < 0 EndFunc GetResult() Overall, I'm happy with the results and grateful for the help I got here from everybody. I couldn't keep the CPU at the 0.26% I got earlier, but it's not that far at between 0.39% and 0.77% with all the error checking and everything (the StringSplit() understandably adds a bit more up to 1% on occasion, of course). I will mark @argumentum's reply about the error checking as the solution, because he led me to the most efficient path to fix these errors and was instrumental in me finding the dictionary approach that helped replace the _ProcessGetName() function when it came to the ID and name coupling. Thanks again!
    1 point
  6. Here how you can test if another process is run elevated or not : #include <WinAPIProc.au3> #include <ProcessConstants.au3> Local $iPID = ProcessExists("excel.exe") ConsoleWrite($iPID & @CRLF) Local $hProcess = _WinAPI_OpenProcess($PROCESS_QUERY_LIMITED_INFORMATION, False, $iPID, False) ConsoleWrite($hProcess & @CRLF) Local $hToken = _WinAPI_OpenProcessToken($TOKEN_ALL_ACCESS, $hProcess) If $hToken Then ConsoleWrite("Process is not elevated" & @CRLF) _WinAPI_CloseHandle($hToken) Else ConsoleWrite("Process is elevated" & @CRLF) EndIf _WinAPI_CloseHandle($hProcess)
    1 point
  7. ioa747

    cmd to AutoIt

    for a better simulation, in the folders you made in d:\main change the folder icons, this has the effect of creating desktop.ini in each folder when you run the script, then the folder icons inside the E folder will also change here you need update the attributes οf the dir to read only - remove the ; from ;FileSetAttrib($Folder, "+R") and change from "Desktop.txt" to "Desktop.ini"
    1 point
  8. Hello, use _ClipPutFile() If you place multiple FullFilePathNames, separated by "|" into one string, you can place them all-in-one to the clipboard, regardless of the folders these files are stored in. In your screenshot you already used this function, I didn't get, why you are not happy with that one? I used it in several "Collect files across many differnt folders" tools, no problems. $put2clip="C:\temp\File-1.txt|D:\OtherDrive\anotherfolder\file-2.txt|\\server\share\path\file-3.txt" _ClipPutFile($put2clip)
    1 point
  9. ioa747

    cmd to AutoIt

    in order for it to work normally, and to get the information from the desktop.ini you need update the attributes οf the dir to read only (if it doesn't already have it) Edit: I updated the code Edit: also pay attention to the parameters $iRecur, $iReturn of the _FileListToArrayRec() function
    1 point
  10. ioa747

    cmd to AutoIt

    see if you need an adjustment ; https://www.autoitscript.com/forum/topic/211214-cmd-to-autoit/#comment-1527768 #include <File.au3> _FindAllFile() ;---------------------------------------------------------------------------------------- Func _FindAllFile() Local $oldPath = "D:\Install\System_Config\ini_files\E\" Local $newPath = "E:\" Local $Folder $ArraySrtfiles = _FileListToArrayRec($oldPath, "desktop.ini", $FLTAR_FILES, $FLTAR_RECUR) If Not IsArray($ArraySrtfiles) Then ConsoleWrite($oldPath & " = Invalid input path" & @CRLF) Return Else For $x = 1 To $ArraySrtfiles[0] ConsoleWrite($oldPath & $ArraySrtfiles[$x] & " -> " & $newPath & $ArraySrtfiles[$x] & @CRLF) FileCopy($oldPath & $ArraySrtfiles[$x], $newPath & $ArraySrtfiles[$x], 1) $Folder = StringLeft($newPath & $ArraySrtfiles[$x], StringInStr($newPath & $ArraySrtfiles[$x], '\', 0, -1)) FileSetAttrib($Folder, "+R") Next EndIf EndFunc ;==>_FindAllFile ;----------------------------------------------------------------------------------------
    1 point
  11. Still taking a break, but update: I will be returning to this project, soonish. Probably by the start of the new year (hopefully). Sorry to keep those interested waiting so long for updates to this code. I've been requested by some staff and friends on a couple IRC networks to make an IRC bot in python. This is a dual project that I am writing in autoit and python (to appeal to two crowds). The autoit version is just for fun, the python version is going to be implemented thru egg drop on their IRC networks, and whoever else may be interested in using it. What is it? Well it's a FOSS DuckHunt bot. Currently the only half-decent version of DuckHunt available for egg dropping is written in TCL (there is also a add-on for supy bot, but not that great and some other lesser known versions out there.) The original TCL version (based off the NES classic), written by Menz Agitat, (and modified versions) is quite fun, but lags profusely in larger chats when multiple users play. I am attempting to eliminate this issue by writing a new version of this in a more capable language (calling it Super DuckHunt, to follow a Nintendo-era feel). When I roll out these two scripts for beta testing, I will post information here on the forum for those interested in the autoit (or python) versions. 😎
    1 point
  12. #include <WinAPIRes.au3> ; _WinAPI_SetSystemCursor() #include <WinAPISys.au3> ; _WinAPI_SystemParametersInfo() #include <WinAPIsysinfoConstants.au3> ; for $SPI_SETCURSORS ;~ Local $hPrev = _WinAPI_CopyCursor(_WinAPI_LoadCursor(0, $OCR_NORMAL)) ; Is not going to be used because ... _WinAPI_SetSystemCursor(_WinAPI_LoadCursorFromFile(StringLeft(@AutoItExe, _ StringInStr(@AutoItExe, '\', 0, -1) -1) & '\Examples\Helpfile\Extras\Lens.cur'), $OCR_NORMAL) Sleep(5000) ;~ _WinAPI_SetSystemCursor($hPrev, $OCR_NORMAL) ... we are gonna use SystemParametersInfo _WinAPI_SystemParametersInfo($SPI_SETCURSORS, 0, 0, 0) My drama was to restore the original back and the above does just that. The get part is in the registry. Unless someone finds something better, then its solved.
    1 point
  13. Jon

    Random DoS Attacks

    Hi, some random DoS attacks ongoing at the mo. Server is auto banning, but maybe some outages. Thanks, Jos, for letting me know,
    1 point
  14. Yes, we have those here and there (including my Container UDF), but i didn't find one that able to pass arrays or other types to be reliable enough. Differences from other analogs: Stability (reliability) Array support (2D ATM) Ability to get the return data from the interaction process Easy both ways interaction Notes: Examples (run both)... Downloads: AppInteract_v0.5.zip AppInteract_v0.4.zip AppInteract_v0.3.zip AppInteract_v0.2.zip AppInteract_v0.1.zip
    1 point
  15. 0 points
×
×
  • Create New...