Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/07/2023 in all areas

  1. 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,
    4 points
  2. I'll have a look to see if I get the same. Working on Autoit3wrapper anyway to get rid of mailslots.
    1 point
  3. Jos

    MailSlot

    Thanks for that UDF, It was super simple to implement and replace the current mailslot stuff in AutoIt3Wrapper!
    1 point
  4. Generally speaking, the support for autoit AU3 file drag and drop is not perfect AU3 built-in GUI $WS_ EX_ ACCESSFILES, Control $GUI_ DROPACCEPTED, then @ GUI_ DropId distinguishes the control that occurs, but @ GUI_ DragFile does not support multiple files, only the first file is recognized! And dragging into the window means dragging and dropping the cursor, without distinguishing the display of controls. Common WM_DROPFILES_FUNC, DllCall shell32.dll DragQueryFile, GUI window also $WS_ EX_ ACCESSFILES, supports multiple files, but requires GUI event mode 1, and cannot distinguish which control occurred, making it difficult to handle when there are multiple different drag and drop destinations. Similarly, dragging the cursor into the window does not distinguish the display of controls. Here is an example of AU3 source code that can determine which control triggers the drag, and can support multiple files being dragged in at once, which can be processed one by one without setting GUIOnEventMode to 1 Running under WIN11 has passed. The image shows the system wallpaper of WIN11 or WIN7. If you don't have it, please replace it yourself Select multiple files in the system file browser, then drag them into the program window. When pointing to the blank space, cursor as disabled. When pointing to the Input input box and image, you can release the mouse to complete the drag and drop. The effect is that the input box displays all the file names that were dragged and dropped, and displays the recently dragged control hWnd,for easy differentiation ================== #include <GUIConstants.au3> #include <WinAPI.au3> #include <Array.au3> Global $aFileList, $lastDragID $hGUI = GUICreate("Independent control multi file drag", 565, 247, -1, -1, -1, $WS_EX_WINDOWEDGE) $Input1 = GUICtrlCreateInput("", 32, 16, 505, 121) ; Now only here the drop sign appears $defpic1 = "C:\Windows\Web\Wallpaper\Spotlight\img50.jpg" ;win11壁纸1 $defpic2 = "C:\Windows\Web\Wallpaper\Windows\img19.jpg" ;win11壁纸2 $defpic = "" For $i = 1 To 5 If Random(0, 1, 1) Then $defpic = $defpic1 Else $defpic = $defpic2 EndIf Assign("Pic" & $i & "Handle", GUICtrlCreatePic($defpic, 20 + (($i - 1) * 100), 180, 90, 50, -1, $WS_EX_ACCEPTFILES)) GUICtrlSetState(Eval("Pic" & $i & "Handle"), $GUI_DROPACCEPTED) Next GUICtrlSetState(-1, $GUI_DROPACCEPTED) Global $idDummy = GUICtrlCreateDummy() GUISetState() $wProcHandle = DllCallbackRegister("_WindowProc", "ptr", "hwnd;uint;wparam;lparam") For $i = 1 To 5 Assign("gchp" & $i, GUICtrlGetHandle(Eval("Pic" & $i & "Handle"))) Assign("wProcOld" & $i, _WinAPI_SetWindowLong(Eval("gchp" & $i), $GWL_WNDPROC, DllCallbackGetPtr($wProcHandle))) Next While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $idDummy For $i = 1 To $aFileList[0] ConsoleWrite($aFileList[$i] & @CRLF) ;拖放处理文件段 Next GUICtrlSetData($Input1, $lastDragID & "##" & _ArrayToString($aFileList, "|", 1)) For $i = 1 To 5;提示哪个控件响应 If Eval("gchp" & $i) = $lastDragID Then MsgBox(0, "idP-" & $i, _ArrayToString($aFileList, @CRLF, 1)) Next EndSwitch WEnd GUIDelete($hGUI) DllCallbackFree($wProcHandle) Func _WindowProc($hWnd, $Msg, $wParam, $lParam) For $j = 1 To 5 ;拖放识别控件段 If $hWnd = GUICtrlGetHandle(Eval("Pic" & $j & "Handle")) Then isDrag($hWnd, $Msg, $wParam, $lParam, Eval("wProcOld" & $j)) Next EndFunc ;==>_WindowProc Func isDrag($hWnd2, $Msg2, $wParam2, $lParam2, $wProcOldx) If $Msg2 = $WM_DROPFILES Then $lastDragID = $hWnd2 ConsoleWrite($lastDragID & @CRLF) $aFileList = _WinAPI_DragQueryFileEx($wParam2) If Not @error Then GUICtrlSendToDummy($idDummy) _WinAPI_DragFinish($wParam2) Return 0 Else Return _WinAPI_CallWindowProc($wProcOldx, $hWnd2, $Msg2, $wParam2, $lParam2) ;放行相应控件的其它消息 EndIf EndFunc ;==>isDrag ================= 单控件多文件拖放22.au3
    1 point
  5. pixelsearch

    ReDim error code

    @argumentum first of all I'd modify 2 variables names so the script becomes much easier to read. These 2 variables are $aRow and $aCol, their names should really be swapped because $aRow should refer to rows and $aCol to columns... unless you like headaches This would lead to this basic script, where some original lines are commented out, so everybody can see easily what has been modified : Func _ArrayFromString($sArrayStr, $sDelim_Col = "|", $sDelim_Row = @CRLF, $bOpt = Default, $iStripWS = $STR_STRIPLEADING + $STR_STRIPTRAILING) If $sDelim_Col = Default Then $sDelim_Col = "|" If $sDelim_Row = Default Then $sDelim_Row = @CRLF If $bOpt = Default Then $bOpt = 0 ; Force 2D = 1, redim array = 2 If $iStripWS = Default Then $iStripWS = $STR_STRIPLEADING + $STR_STRIPTRAILING ; Local $aRow, $aCol = StringSplit($sArrayStr, $sDelim_Row, $STR_ENTIRESPLIT + $STR_NOCOUNT) Local $aCol, $aRow = StringSplit($sArrayStr, $sDelim_Row, $STR_ENTIRESPLIT + $STR_NOCOUNT) ; $aRow = StringSplit($aCol[0], $sDelim_Col, $STR_ENTIRESPLIT + $STR_NOCOUNT) $aCol = StringSplit($aRow[0], $sDelim_Col, $STR_ENTIRESPLIT + $STR_NOCOUNT) ; If UBound($aCol) = 1 And Not BitAND(1, Int($bOpt)) Then If UBound($aRow) = 1 And Not BitAND(1, Int($bOpt)) Then ; For $m = 0 To UBound($aRow) - 1 For $m = 0 To UBound($aCol) - 1 ; $aRow[$m] = ($iStripWS ? StringStripWS($aRow[$m], $iStripWS) : $aRow[$m]) $aCol[$m] = ($iStripWS ? StringStripWS($aCol[$m], $iStripWS) : $aCol[$m]) Next ; Return $aRow Return $aCol EndIf ; Local $aRet[UBound($aCol)][UBound($aRow)] Local $aRet[UBound($aRow)][UBound($aCol)] ; For $n = 0 To UBound($aCol) - 1 For $n = 0 To UBound($aRow) - 1 ; $aRow = StringSplit($aCol[$n], $sDelim_Col, $STR_ENTIRESPLIT + $STR_NOCOUNT) $aCol = StringSplit($aRow[$n], $sDelim_Col, $STR_ENTIRESPLIT + $STR_NOCOUNT) ; If UBound($aRow) > UBound($aRet, 2) Then If UBound($aCol) > UBound($aRet, 2) Then If Not BitAND(2, $bOpt) Then Return SetError(1) ; ReDim $aRet[UBound($aRet)][UBound($aRow)] ReDim $aRet[UBound($aRet)][UBound($aCol)] EndIf ; For $m = 0 To UBound($aRow) - 1 For $m = 0 To UBound($aCol) - 1 ; $aRet[$n][$m] = ($iStripWS ? StringStripWS($aRow[$m], $iStripWS) : $aRow[$m]) $aRet[$n][$m] = ($iStripWS ? StringStripWS($aCol[$m], $iStripWS) : $aCol[$m]) Next Next Return $aRet EndFunc ;==>_ArrayFromString I just checked that you're working on this function for a while, in these links : https://www.autoitscript.com/forum/topic/197277-_arrayfromstring/ https://www.autoitscript.com/trac/autoit/ticket/3696 On June 12 2021, Jon added your function _ArrayFromString in AutoIt v3.3.15.4 Beta and it's here now in actual release 3.3.16.1 . Maybe most users still don't know this function exists, which could explain why it's not more used, because it's an interesting function. For the record, I discovered your function when @OJBakker mentioned it (and used it) in this post. Apparently, _FileReadToArray() is an alternative to your function (though _FileReadToArray requires a file to be read, when your function requires a string, no big deal) . One major difference between _FileReadToArray and _ArrayFromString is that _FileReadToArray generates an @error 3 ("3 - File lines have different numbers of fields, only if $FRTA_INTARRAYS flag not set") but you want _ArrayFromString to be able to ReDim "on the fly" while the function is executing, in case a row being processed got more column delimiters than the number of column delimiters found initially in Row 0 An idea would be to check the number of elements immediately after these 2 lines : Local $aCol, $aRow = StringSplit($sArrayStr, $sDelim_Row, $STR_ENTIRESPLIT + $STR_NOCOUNT) $aCol = StringSplit($aRow[0], $sDelim_Col, $STR_ENTIRESPLIT + $STR_NOCOUNT) Local $iNbElements = Ubound($aRow) * Ubound($aCol) ; check if not > 16.777.216 Of course this will not work in case $aRow (mostly) got more than 16.777.216 elements (rows) because StringSplit() would already have generated a fatal error. Let's go on. Later in the script, just before you use the eventual ReDim function, just check again what will become the expanded number of elements (compared to 16.777.216) to decide if an error will be generated or not. I'm not forgetting what I asked you a couple of months ago : why this kind of string outputs as a 2D array ? Shouldn't it output as a 1D array ? Local $aArray = _ArrayFromString("1" & @CRLF & "2") ConsoleWrite(Ubound($aArray, $UBOUND_DIMENSIONS) & @crlf) ; 2 For the record, there were 7 persons working on _FileReadToArray, maybe we could hire a couple of them to make yours 100% safe too ; _FileReadToArray ; Author ........: Jonathan Bennett <jon at autoitscript dot com>, Valik - Support Windows Unix and Mac line separator ; Modified ......: Jpm - fixed empty line at the end, Gary Fixed file contains only 1 line, guinness - Optional flag to return the array count. ;                : Melba23 - Read to 1D/2D arrays, guinness & jchd - Removed looping through 1D array with $FRTA_COUNT flag.
    1 point
  6. pixelsearch

    ReDim error code

    Hi argumentum The help file indicates this, in its topic "AutoIt3 Limits/defaults" VAR_SUBSCRIPT_ELEMENTS Value : 16,777,216 Description : Maximum number of elements for an array.  So I just tested this value with the following examples, hope it will help : ; 1D ; Local $aArray[16777216] ; ok ; Local $aArray[16777216 + 1] ; crash ; 2D's ; Local $aArray[16777216][1] ; ok ; Local $aArray[16777216 + 1][1] ; crash ; Local $aArray[16777216 / 2][2] ; ok ; Local $aArray[(16777216 / 2) + 1][2] ; crash ; Local $aArray[16777216 / 4][4] ; ok ; Local $aArray[(16777216 / 4) + 1][4] ; crash ; ... ; Local $aArray[4][16777216 / 4] ; ok ; Local $aArray[4][(16777216 / 4) +1] ; crash ; Local $aArray[2][16777216 / 2] ; ok ; Local $aArray[2][(16777216 / 2) +1] ; crash ; Local $aArray[1][16777216] ; ok ; Local $aArray[1][16777216 + 1] ; crash
    1 point
  7. Jon

    Forum Rules

    We want the forum to be a pleasant place for everyone to discuss AutoIt scripting, and we also want to protect the reputation of AutoIt. So we ask you to respect these simple rules while you are here: Forum Posting 1. Do not ask for help with AutoIt scripts, post links to, or start discussion topics on the following subjects: Malware of any form - trojan, virus, keylogger, spam tool, "joke/spoof" script, etc. Bypassing of security measures - log-in and security dialogs, CAPTCHAs, anti-bot agents, software activation, etc. Automation of software/sites contrary to their EULA (see Reporting bullet below). Launching, automation or script interaction with games or game servers, regardless of the game. Running or injecting any code (in any form) intended to alter the original functionality of another process. Decompilation of AutoIt scripts or details of decompiler software. This list is non-exhaustive - the Moderating team reserve the right to close any thread that they feel is contrary to the ethos of the forum. 2. Do not post material that could be considered pornographic, violent or explicit - or express personal opinions that would not be acceptable in a civilized society. Do not post any copyrighted material unless the copyright is owned by you or by this site. 3. To protect this community, any files posted by you are subject to checks to ensure that they do not contain malware. This includes, but is not limited to, decompilation and reverse engineering. 4. Do not flame or insult other members - and just report the thread to a Moderator (see below) if you are so attacked. 5. Do not PM other users asking for support - that is why the forum exists, so post there instead. 6. Do not create multiple accounts - if you inadvertently created multiple accounts then contact a Moderator to close the unwanted ones. 7. Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above. 8. Do not delete your posts, nor completely remove their content, if doing so will interrupt the flow of the thread. 9. Do not post in a thread while the Moderating team are actively trying to determine whether it is legal. The Moderation team will do their best to act in fair and reasonable manner. Sanctions will only be applied as a last resort and any action taken will be explained in the relevant thread. If moderation action is taken, you will need to acknowledge this through a dialog or you will be unable to post further in the forum. Please note that this dialog is not an agreement that the warning was justified - it is only there so that members are aware that moderation action has been taken and that they may have certain restrictions applied to their account. If you feel that you have been unfairly moderated then contact the Moderator concerned - using a PM or the "Report" button is preferable to opening a new thread (although new members may have to do this). But do be aware that the Moderation team has the final word - the rules are set out by the site owner and you are only welcome here if you respect his wishes. Signatures and Avatars There is no formal policy for the use of signatures but if a moderator thinks it is too big and/or distracting then you may be asked to tone it down. No-one likes wading through signatures that are a page high. Similarly for avatars, expect distracting flashing and animated gifs to be removed. Reporting If you feel a post needs Moderator attention, please use the "Report" button next to the post date at the top. You can then enter details of why you have reported the post - but there is no need to include the content of the post as that is done automatically. The Moderating team will be alerted to the post and will deal with it as soon as they can. If you suspect a EULA violation, do not expect the Moderating team to do all the work - please provide some evidence in the report such as a copy of (or link to) the EULA in question, as well as the section you believe has been violated. Finally, please do not enter into an argument with the original poster - that is why we have Moderators. Spam Please do not react to spam in any way other than reporting it. Multiple reports are combined by the forum software, so there is no need to announce that you have reported the spam - in fact doing so only increases the work for the Moderator who deals with it. Interacting with this website Anyone found abusing the website is subject to harsh punishment without warning. A non-exhaustive list of potential abuses include: Automated forum registration or login. Automated posting or sending messages on the forum. Automated manipulation of polls, user reputation or other forum features. Automated creation or comments on issue tracker tickets. Automated creation or editing of wiki pages. Other abuses which are either examples of excessive bandwidth usage or automation of the site. Use common sense. If you do not have common sense, don't do anything. Do not automate the forum, wiki or issue tracker in any way at all. Scripts which automatically update AutoIt such as AutoUpdateIt are acceptable as long as they are not abused and do not generate excessive bandwidth usage.
    1 point
  8. Read more here : https://mspoweruser.com/vbscript-deprecated-windows-11-windows-10/
    0 points
×
×
  • Create New...