Leaderboard
Popular Content
Showing content with the highest reputation on 11/05/2018 in Posts
-
wolflake, You are calling GUIGetMsg twice in your idle loop - once to check for the Accel keys and then again in the Do...Until structure you use to look for the closure [X]. Little wonder you miss the odd event! Replace the Do...Until with a While...WEnd and add a Case $GUI_EVENT_CLOSE case in the Switch structure and all should work correctly. And you can remove the Sleep too - GUIGetMsg has a built-in pause to keep the CPU from frying. M232 points
-
RegExp Quick Tester
pixelsearch reacted to Lazycat for a topic
Since I start using RegExp more and more, I need a tool for quickly testing patterns. I tried script, created by steve8tch and w0uter, it's works fine, but I was bored to click Test button after 5 minutes So, here is my version. It's concept is a bit different, this is not work with big files, because it's goal - quick testing. But it can: Results are showing instantly while editingSupport replace pattern testing as wellText and patterns are automatically saving between sessionsMiddle mouse button click on search pattern editbox show menu with characters quick referenceEdit: updated code, fixed noticeable probs. Most likely this will be last version, if I would tried w0uter's version first (which suitable my needs), this would not appear Edit: 2006-07-22: small fix - middlebutton context menu will show only when window active. 2007-10-09: version 2.5, updated to new PCRE and so on RegExpQuickTester25.zip1 point -
Are my AutoIt exes really infected?
Leendert-Jan reacted to JSThePatriot for a topic
If you have been using AutoIt for any length of time you will know that it is a great, and powerful scripting language. As with all powerful languages there comes a downside. Virus creation by those that are malicious. AutoIt has no virii installed on your system, and if a script you have created has been marked as a virus, (and you're not malicious) then this is a false positive. They found a set of instructions in an AutoIt EXE out there somewhere, took the general signature of the file, and now all AutoIt EXE's are marked (or most of them). This can be due to several reasons. AutoIt is packed with UPX. UPX is an open source software compression packer. It is used with many virii (to make them smaller). Malicious scripter got the AutoIt script engine recognized as a virus. And I am sure there are more ways your executable could be marked, but that covers the basics. Now I am sure you are wanting to know what you can do to get back up and running without being recognized as a virus. You have to send in a report to the offending AV company alerting them to the false positive they have made. It never hurts to send in your source code along with a compiled exe, to help them realize their mistake. You may have to wait up to 24 hours for them to release an update. The time it takes really depends on the offending AV company. Anti-Virus Links AntiVir Website Contact Avast! Website Contact McAfee Website Contact (email address) Symantec (Norton) Website Contact AVG Website Contact (It says sales or other ?'s I assume this will work) ClamWin Website Contact ClamAV Website Contact (I would only contact the ones with "virusdb maintainer or virus submission management") BitDefender Website Contact ZoneLabs Website Contact Norman Website Contact (email address) eSafe Website Contact (login required) A2 (A-Squared) Website Contact (email address) Edit: Added Website links and Contact links. I hope this helps you understand why your AutoIt executables are marked as virii. JS1 point -
I think I found the issue ...... although the real issue is you are upgrading SciTE4AutoIt3 without upgrading AutoIt3! Add the below line to Autoit3Wrapper line 51: #include <APIResConstants.au3> .. and try again please. Jos1 point
-
@TheXman You rock!!! Thank you so much for this solution! Someone give this guy a medal!1 point
-
_cFileSelectFolder() is intended as a replacement for native FileSelectFolder() for selecting folders: it implements the left pane of FileSelectFolder(). It goes beyond FileSelectFolder() in several ways. Features: • It is user friendly and designed to be easy to use; • Its GUI can be placed anywhere, including centred on another window; • It neither needs nor uses CLSIDs; • It checks calling parameters rigorously, either showing a user error message in a dialog or by returning the message and setting @error to 1. • For local and mapped drives, it accepts file specifications with drives that can be drive letters, drive labels, or both, • For unmapped drives on computers on the network, it offers a shortcut to shares. • For local and mapped drives, it always returns drive letter:\ ... so its output is compatible with native AutoIt functions. The initial display can be: • The Desktop hierarchy with Desktop at the top • Partial Desktop hierarchy with any other Desktop item at the top, with or without local/mapped drives and file folders, or remote shares and file folders (as appropriate), • Local/mapped drives and file folders, or • Remote shares and folders. The script and example scripts are in the zip file. Documentation beyond what is in the UDF header is in a PDF file. Both are here1 point
-
How to automate button click in a GUI?
Iulia_Vascan reacted to Earthshine for a topic
what if dolomites runs somewhere else on the screen? this is more reliable that that stuff. user can change the size and location of the window and it would still work if those controls could be gotten to.1 point -
I actually found a few typos. I corrected them in the post above.1 point
-
The SetOption() method is not a member of the Msxml2.XMLHTTP object. You want to use the Msxml2.ServerXMLHTTP object. The Msxml2.ServerXMLHTTP object is very similar to the Msxml2.XMLHTTP as you can see below. I modified your code to use the Msxml2.ServerXMLHTTP object below. Of course I can't test it. Hopefully I didn't make any typos. I only modified 3 lines (ObjCreate(), Open(), SetOption() ". I also added the constants for the SetOption() method and the values for ignoring SSL errors in case you prefer to use named values instead of magic numbers. Func SendXmlPostRequest($url, $auth, $xml) ; Make a POST request to Genesis and get the response. Enum $SXH_OPTION_URL_CODEPAGE, _ $SXH_OPTION_ESCAPE_PERCENT_IN_URL, _ $SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS, _ $SXH_OPTION_SELECT_CLIENT_SSL_CERT Enum $SXH_SERVER_CERT_IGNORE_UNKNOWN_CA = 0x0100, _ $SXH_SERVER_CERT_IGNORE_WRONG_USAGE = 0x0200, _ $SXH_SERVER_CERT_IGNORE_CERT_CN_INVALID = 0x1000, _ $SXH_SERVER_CERT_IGNORE_CERT_DATE_INVALID = 0x2000, _ $SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = 0x3300 Global $oHTTP = ObjCreate('Msxml2.ServerXMLHTTP') ;<== Modified $oHTTP.open('POST', $url) ;<== Modified $oHTTP.setRequestHeader('Authorization', 'Basic' & ' ' & $auth) $oHTTP.setRequestHeader('Content-type', 'application/xml') $oHTTP.setOption(2, 0x3300) ;<== Modified $oHTTP.send($xml) $responseText = $oHTTP.responseText $responseStatus = $oHTTP.rtatus If $responseStatus <> 200 Then ; Check the response code from the server. MsgBox(0, 'Message', 'Request failed on subimtion with Response Status:' & ' ' & $responseStatus) Exit EndIf $getCodeArr = _StringBetween($responseText, '<code>', '</code>') $getCode = $getCodeArr If $getCode <> 0 And $getCode <> 200 Then ; Check the response code from the gateway. $getTechicalMessageArr = _StringBetween($responseText, '<technical_message>', '</technical_message>') $getTechicalMessage = $getTechicalMessageArr MsgBox(0, 'Message', 'Request failed with:' & @CRLF & 'Response Code:' & ' ' & $getCodeArr[0] & @CRLF & 'Technical Message:' & ' ' & $getTechicalMessageArr[0]) Exit EndIf If $responseStatus = 200 Then $getTransType = _StringBetween($responseText, '<transaction_type>', '</transaction_type>') If $getTransType[0] = "capture" Then $getCaptureUniqueID = _StringBetween($responseText, '<unique_id>', '</unique_id>') ElseIf $getTransType[0] = "void" Then $getVoidUniqueID = _StringBetween($responseText, '<unique_id>', '</unique_id>') ElseIf $getTransType[0] = "refund" Then $getRefundUniqueID = _StringBetween($responseText, '<unique_id>', '</unique_id>') ElseIf $getTransType[0] = "credit" Then $getCreditUniqueID = _StringBetween($responseText, '<unique_id>', '</unique_id>') ElseIf $getTransType[0] = "recurring_sale" Then $getRecurringSaleUniqueID = _StringBetween($responseText, '<unique_id>', '</unique_id>') Else $getUniqueID = _StringBetween($responseText, '<unique_id>', '</unique_id>') $uniqueID = $getUniqueID[0] EndIf EndIf EndFunc ;==>SendXmlPostRequest1 point
-
How to automate button click in a GUI?
Iulia_Vascan reacted to caramen for a topic
Pm information requested since i noticed the pole button ? PM me what is this soft usage ?1 point -
1 point
-
Form Builder beta
mLipok reacted to BuckMaster for a topic
Update v1.0.6 Major script overhaul, I literally started over from scratch only adding parts of code from the old script that were solid. I don’t have a help file made as of now so I am going to explain all of the functionality in this post - Form Builder is no longer bi-directional, you now toggle between script mode and GUI mode using a button in the top right or F4 - The script no longer recompiles on every change but instead inserts changes into the script - Form Builder no longer cares about Event mode or GuiGetMsg mode - No more .gui files, you now edit .au3 scripts directly - Script edit is now a SciLexer control, includes syntax highlighting, folding, call tips, keywords, and inline error annotations. - Script output console is now at the bottom in script mode - Main GUI menu redone, most functions from SciTe have been added along with their hotkeys - All restrictions to editing the script have been removed - GDI+ and Graphic editors removed - Cleanup of script, stability greatly increased - Hotkeys no longer use _IsPressed they now use GUIAccelerator keys (with exception to a few) - Multiple scripts can be open - Form Builder buffers the open scripts and adds an asterisk * to scripts that have been modified - Rich Edit, GUIScrollbars, Dummy, and Updown are disabled for now until I can add them - GUI Menu controls cannot be created as of now but will be rendered in the editor - Undo and Redo actions in script mode and GUI mode added, the GUI undo and redo buffer is cleared switching between modes - The Undo and Redo buffers do not have a limit but are cleared when switching between modes or scripts - Undo and Redo actions do not work for controls that have no control handle - The Treeview now works as a Go to function for controls and functions in script mode - Form Builder now tries to preserve as much of the original content as possible, it will save whitespace in-between parameters and comments on controls - Treeview context menu reworked, much more responsive - Unicode support added File -> Encoding -> UTF-8 - Language support added, I added a couple of language files and used Google translate just so I could size my GUI's for different languages, I do not support what those language files say - Selecting a GUI in the Treeview in GUI mode will allow you to change the GUI's Handle, Position, Background Color, State, Cursor, Font, Font Size and Font Attributes - Auto Declare is no longer hiding in the settings, it is now on the top right and is a toggle between Off, Global and Local - Help File Lookup added (Ctrl + H), allows you to search selected text in the help file, Any variable will be searched and the first result will be displayed, any string will be searched as a keyword in the index - Added current script line, column, and selection length in the bottom left - Standard undeclared style constants are checked before script execution and the script will prompt if an undefined style constant is found - You can now toggle script whitespace, EOL characters, line numbers, margins and output in the View menu - View -> Toggle All Folds works as it does in SciTe, only base level folds are changed and the first fold found determines whether to expand or contract - Form Builder Settings redone - Bugs with submitting data and control selection have been fixed - Fixed problems with frequently called repetitive functions causing issues with large scripts - Fixed bugs with B, I, U and S font attribute buttons getting stuck and called when enter was pressed Update v1.0.7 - Help File Look-up hotkey changed to Ctrl+B - Replace hotkey changed to Ctrl+H - Changes to $SCN_MODIFIED so only text events are notified - Bookmarks added, Ctrl+M to add or delete a Bookmark from the current line - Edit -> Bookmarks -> Set Bookmark changes the currently selected Bookmark - Edit -> Clear Current Bookmarks deletes only the currently selected Bookmark - Allows you to change foreground and background colors of Bookmarks - Added F2 hotkey for Next Bookmark - Added Shift+F2 hotkey for Previous Bookmark - Fixed a bug that made it so script annotation did not show up for some people - Script errors and warnings now add a Bookmark on each line - Ctrl+E hotkey added to clear all Bookmarks and Annotations - Minor GUI tweaks - Fixed a bug with the GUI Style undo action - Undo and Redo actions for GUI windows will now update the window properties if the GUI is selected - F4 Hotkey no longer switches modes, switching modes is now F10 - F4 is to toggle next error or warning message, works like it does in SciTe, bookmarks the line and highlights the error in the console - Shift+F4 Hotkey added to toggle previous error or warning message - Shift+F5 Hotkey added to clear script output - Ctrl+F5 Hotkey added as SyntaxCheck Prod - Form Builder now performs a SyntaxCheck before entering GUI Mode and prompts on Error or Warning - Language Select Menu Added Settings -> Lanugage - Icons added to main menu - Languages added to all new menu items and msgbox's - Language Files updated for new data - Language Support added for Arabic, Chinese, Dutch, French, German, Hebrew, Japanese, Swedish, Thai, and Vietnamese [ Google Translate ] - Fixed bug with updating a language that made it look like ANSI and UTF-8 were both selected - Added redo button next to undo button - Font attribute buttons Bold, Italic, Underline and Strike-Out changed to labels Update v1.0.8 - Somehow a main function got deleted causing the script to crash on some changes - Fixed some issues with updating Languages Hotkeys Ctrl + N - New Blank Script Ctrl + G - New GUI Script Ctrl + O - Open Script Ctrl + Shift + S - Save As Ctrl + S - Save Esc - Close Open Script Alt + F4 - Exit Ctrl + Z - Undo Ctrl + Y - Redo Ctrl + X - Cut Ctrl + C - Copy Ctrl + V - Paste Ctrl + A - Select All Ctrl + W - Clear inline script annotation Ctrl + E - Clear inline script annotation and bookmarks Ctrl + F - Find Ctrl + F3 - Find Next Shift + F3 - Find Previous (doesn’t work yet) Ctrl + B - Help File Lookup F5 - Go Alt + F5 - Beta Run F7 - Build Ctrl + F7 - Compile F11 - Full screen F8 - Toggle Show/Hide Script Output Ctrl + I - Open Include Ctrl + H - Replace F1 - AutoIt Help File Ctrl + D - Duplicate Control Delete - Delete Control Ctrl + Shift + 8 - Toggle Show/Hide Script Whitespace Ctrl + Shift + 9 - Toggle Show/Hide Script EOL characters Ctrl - GUI Mode multicontrol selection F10 - Switch Modes F4 - Next Message Shift+F4 - Previous Message Shift+F5 - Clear Output Ctrl+M - Add Bookmark F2 - Next Bookmark Shift+F2 - Previous Bookmark Basic GUI Mode How To Create a Control - click a control on the left - click in the GUI you wish to add the control Left Click: Click and drag to auto resize the control Right Click: Creates the control at a standard size Select a Control - click inside the control or select it in the treeview Change a controls Data - First select the control - modify the controls data on the right, press enter to submit changes state, cursor, font and resizing update when you change the data - when modifying the data parameter the script recognizes if there is a variable in the data and will add quotes accordingly ex. data parameter = $data, End result in script: GUICtrlCreateButton($data, 50, 50, 100, 20) ex. data parameter = data, End result in script: GUICtrlCreateButton("data", 50, 50, 100, 20) ex. data parameter = "data"&$data, End result in script: GUICtrlCreateButton("data"&$data, 50, 50, 100, 20) Applying an Image to a control - select a control - control styles must be applied to some controls before adding an image - click the ... button next to the Image input in the Control Properties area in the bottom right - select the image you want to display, allows jpg, bmp, gif, ico and dll files - selecting a dll will open another prompt to choose which resource to display Control Grouping - multiple controls must be selected - press the group controls button - control grouping allows you to resize and move multiple controls at the same time, as of now groups are deleted when leaving GUI mode I only have a couple odds and ends to finish up before everything should be complete, I need to add Undo and Redo actions for copying and duplicating controls and a couple other minor things, eventually I want to try to add all of the UDF controls as well. If people are willing to translate the language file I would be very grateful, the ones I have right now are from Google translate, I only used them for testing and have no idea what they say. I want to thank Kip, Prog@ndy, Isi360 and all of the other contributors on this forum, without you guys i don't think i could have written this script. Please post any comments, problems or suggestions, BuckMaster * I only used one "magic number" on my main close case statement, only for faster locating, and i don't care. Form Builder Source.zip Form Builder.zip1 point -
_ProcessListProperties()
mistersquirrle reacted to PsaltyDS for a topic
The _ProcessListProperties() function has been floating around General Help and Support long enough. This is it's new home. This function lists several properties of all processes (default), selected processes by name, or a single process by PID. ===> Important bug note: The SwbemRefresher object has a Microsoft bug that causes a memory leak when called repeatedly. Until a fix is found from Microsoft, don't use _ProcessListProperties() in a tight loop. <=== Change Log: 05/05/2008 -- v1.0.0 -- First version placed in Example Scripts 05/07/2008 -- v1.0.1 -- Added the calling command line at [n][9] 06/10/2008 -- v2.0.0 -- Removed use of ProcessList() so remote access could work 06/12/2008 -- v2.0.1 -- Added geeky RegExp for WMI date conversion by weaponx 07/02/2008 -- v2.0.2 -- Fixed find by PID or Name, which was broken by removing ProcessList() usage 09/17/2008 -- v2.0.3 -- Added Debug (SeDebugPrivilege) to WMI call to retrieve fuller results 12/15/2008 -- v2.0.3 -- No change to function, cleaned up demo and added COM error handler to it12/01/2009 -- v2.0.4 -- Fixed check for null $Process so '0' could be used (System Idle Process) Information is returned in a 2D array similar to the native ProcessList(), in fact the UDF uses ProcessList() internally. This is the structure of the array: [0][0] - Number of processes listed (can be 0 if no matches found) [1][0] - 1st process name [1][1] - 1st process PID [1][2] - 1st process Parent PID [1][3] - 1st process owner [1][4] - 1st process priority (0 = low, 31 = high) [1][5] - 1st process executable path [1][6] - 1st process CPU usage [1][7] - 1st process memory usage [1][8] - 1st process creation date/time = "MM/DD/YYY hh:mm:ss" [1][9] - 1st process command line string ... [n][0] thru [n][9] - last process properties Here is the function, with a running demo script: #include <Array.au3>; Only for _ArrayDisplay() ; Install a custom error handler Global $oMyError = ObjEvent("AutoIt.Error","MyErrFunc"), $f_COMError = False ; Globals Global $avRET, $iPID ; Demonstrate listing all processes $avRET = _ProcessListProperties() _ArrayDisplay($avRET, "All Processes") ; Demonstrate listing by name $avRET = _ProcessListProperties("svchost.exe") _ArrayDisplay($avRET, "By name: 'svchost.exe'") ; Demonstrate listing by PID (integer) $iPID = ProcessExists("svchost.exe") $avRET = _ProcessListProperties($iPID) _ArrayDisplay($avRET, "By int PID: " & $iPID) ; Demonstrate listing by PID (numeric string) $iPID = String($iPID) $avRET = _ProcessListProperties($iPID) _ArrayDisplay($avRET, "By string PID: " & $iPID) ; Demonstrate not found $avRET = _ProcessListProperties("NoSuchProcess.exe") _ArrayDisplay($avRET, "Not found: 'NoSuchProcess.exe'") ; This is my custom error handler Func MyErrFunc() Local $HexNumber=hex($oMyError.number,8) Msgbox(0,"","We intercepted a COM Error !" & @CRLF & _ "Number is: " & $HexNumber & @CRLF & _ "WinDescription is: " & $oMyError.windescription & @CRLF & _ "Source is: " & $oMyError.source & @CRLF & _ "ScriptLine is: " & $oMyError.scriptline) $f_COMError = True; something to check for when this function returns Endfunc ;=============================================================================== ; Function Name: _ProcessListProperties() ; Description: Get various properties of a process, or all processes ; Call With: _ProcessListProperties( [$Process [, $sComputer]] ) ; Parameter(s): (optional) $Process - PID or name of a process, default is "" (all) ; (optional) $sComputer - remote computer to get list from, default is local ; Requirement(s): AutoIt v3.2.4.9+ ; Return Value(s): On Success - Returns a 2D array of processes, as in ProcessList() ; with additional columns added: ; [0][0] - Number of processes listed (can be 0 if no matches found) ; [1][0] - 1st process name ; [1][1] - 1st process PID ; [1][2] - 1st process Parent PID ; [1][3] - 1st process owner ; [1][4] - 1st process priority (0 = low, 31 = high) ; [1][5] - 1st process executable path ; [1][6] - 1st process CPU usage ; [1][7] - 1st process memory usage ; [1][8] - 1st process creation date/time = "MM/DD/YYY hh:mm:ss" (hh = 00 to 23) ; [1][9] - 1st process command line string ; ... ; [n][0] thru [n][9] - last process properties ; On Failure: Returns array with [0][0] = 0 and sets @Error to non-zero (see code below) ; Author(s): PsaltyDS at http://www.autoitscript.com/forum ; Date/Version: 12/01/2009 -- v2.0.4 ; Notes: If an integer PID or string process name is provided and no match is found, ; then [0][0] = 0 and @error = 0 (not treated as an error, same as ProcessList) ; This function requires admin permissions to the target computer. ; All properties come from the Win32_Process class in WMI. ; To get time-base properties (CPU and Memory usage), a 100ms SWbemRefresher is used. ;=============================================================================== Func _ProcessListProperties($Process = "", $sComputer = ".") Local $sUserName, $sMsg, $sUserDomain, $avProcs, $dtmDate Local $avProcs[1][2] = [[0, ""]], $n = 1 ; Convert PID if passed as string If StringIsInt($Process) Then $Process = Int($Process) ; Connect to WMI and get process objects $oWMI = ObjGet("winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktPrivacy, (Debug)}!\\" & $sComputer & "\root\cimv2") If IsObj($oWMI) Then ; Get collection processes from Win32_Process If $Process == "" Then ; Get all $colProcs = $oWMI.ExecQuery("select * from win32_process") ElseIf IsInt($Process) Then ; Get by PID $colProcs = $oWMI.ExecQuery("select * from win32_process where ProcessId = " & $Process) Else ; Get by Name $colProcs = $oWMI.ExecQuery("select * from win32_process where Name = '" & $Process & "'") EndIf If IsObj($colProcs) Then ; Return for no matches If $colProcs.count = 0 Then Return $avProcs ; Size the array ReDim $avProcs[$colProcs.count + 1][10] $avProcs[0][0] = UBound($avProcs) - 1 ; For each process... For $oProc In $colProcs ; [n][0] = Process name $avProcs[$n][0] = $oProc.name ; [n][1] = Process PID $avProcs[$n][1] = $oProc.ProcessId ; [n][2] = Parent PID $avProcs[$n][2] = $oProc.ParentProcessId ; [n][3] = Owner If $oProc.GetOwner($sUserName, $sUserDomain) = 0 Then $avProcs[$n][3] = $sUserDomain & "\" & $sUserName ; [n][4] = Priority $avProcs[$n][4] = $oProc.Priority ; [n][5] = Executable path $avProcs[$n][5] = $oProc.ExecutablePath ; [n][8] = Creation date/time $dtmDate = $oProc.CreationDate If $dtmDate <> "" Then ; Back referencing RegExp pattern from weaponx Local $sRegExpPatt = "\A(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(?:.*)" $dtmDate = StringRegExpReplace($dtmDate, $sRegExpPatt, "$2/$3/$1 $4:$5:$6") EndIf $avProcs[$n][8] = $dtmDate ; [n][9] = Command line string $avProcs[$n][9] = $oProc.CommandLine ; increment index $n += 1 Next Else SetError(2); Error getting process collection from WMI EndIf ; release the collection object $colProcs = 0 ; Get collection of all processes from Win32_PerfFormattedData_PerfProc_Process ; Have to use an SWbemRefresher to pull the collection, or all Perf data will be zeros Local $oRefresher = ObjCreate("WbemScripting.SWbemRefresher") $colProcs = $oRefresher.AddEnum($oWMI, "Win32_PerfFormattedData_PerfProc_Process" ).objectSet $oRefresher.Refresh ; Time delay before calling refresher Local $iTime = TimerInit() Do Sleep(20) Until TimerDiff($iTime) >= 100 $oRefresher.Refresh ; Get PerfProc data For $oProc In $colProcs ; Find it in the array For $n = 1 To $avProcs[0][0] If $avProcs[$n][1] = $oProc.IDProcess Then ; [n][6] = CPU usage $avProcs[$n][6] = $oProc.PercentProcessorTime ; [n][7] = memory usage $avProcs[$n][7] = $oProc.WorkingSet ExitLoop EndIf Next Next Else SetError(1); Error connecting to WMI EndIf ; Return array Return $avProcs EndFunc ;==>_ProcessListProperties Constructive criticism welcome.1 point -
StringRegExp GUI for testing
pixelsearch reacted to steve8tch for a topic
I have added a little bit to w0uter's original code. - added ability to save RegExp patterns - added ability to read string to test from file (eg load up log files to test) - added 'help' button - reformatted the output I have noticed an odd behavior - 2 of my edit controls can display huge files. I have tested log file 21MB (no problem displaying this) and ran a RegExp test to split up all the words - the 2nd edit control then displayed the results - 1.6 MILLION entries. The other edit control can only display about 20k - all very odd really - it would be really good if one of the DEVs could look at the code to see why an edit control can read 20MB - I thought the the internal AutoIt3 limit for edit controls was 50kB or thereabouts. As ever - it is best to run this script uncompiled as function StringRegExp still being tweaked. The code Attached file StrRegExpGUI_.au31 point -
StringRegExp Design GUI
pixelsearch reacted to w0uter for a topic
[edit] JON you should really fix the code-tag it looks so sloppy. im a bad coder [/edit] this app was designd to easy test regexp patterns on the fly. in like ~4 hours, since i ran into that regexp bug. thought i got all the bugs out but if you find one let me know. #include <GuiConstants.au3> GUICreate("StringRegExp Design GUI -by w0uter", 550, 500, (@DesktopWidth - 550) / 2, (@DesktopHeight - 500) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) GUICtrlCreateGroup("The text to check", 10, 10, 530, 130) GUICtrlCreateGroup("The pattern", 10, 150, 530, 50) GUICtrlCreateGroup("Output", 140, 210, 400, 280) GUICtrlCreateGroup("Return", 10, 210, 120, 100) GUICtrlCreateGroup("@Error", 10, 320, 120, 50) GUICtrlCreateGroup("@Extended", 10, 380, 120, 50) $h_Radio_0 = GUICtrlCreateRadio("True/False", 20, 230, 100, 20) $h_Radio_1 = GUICtrlCreateRadio("Array with the text", 20, 251, 100, 27) $h_Radio_3 = GUICtrlCreateRadio("Array of all results", 20, 280, 100, 20) GUICtrlSetState($h_Radio_3, $GUI_CHECKED) $h_In = GUICtrlCreateEdit("", 20, 30, 510, 100) $h_Out = GUICtrlCreateList("", 150, 226, 380, 262) $h_Pattern = GUICtrlCreateInput("(.*)", 20, 170, 510, 20) $h_Err = GUICtrlCreateInput("0", 20, 340, 100, 20, $ES_READONLY) $h_Ext = GUICtrlCreateInput("bla", 20, 400, 100, 20, $ES_READONLY) $h_Exit = GUICtrlCreateButton("Exit", 10, 440, 120, 50) $v_Reg_Old = 0 GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $h_Exit ExitLoop EndSwitch _Valid() WEnd Func _Valid() $v_Reg = StringRegExp(GUICtrlRead($h_In), GUICtrlRead($h_Pattern), _Option()) Dim $v_EE[2] = [@error, @extended] If $v_EE[0] = 2 Then GUICtrlSetColor($h_Pattern, 0xFF0000) GUICtrlSetData($h_Err, $v_EE[0]) GUICtrlSetData($h_Out, "") Else GUICtrlSetColor($h_Pattern, 0) GUICtrlSetData($h_Err, $v_EE[0]) EndIf GUICtrlSetData($h_Ext, $v_EE[1]) If $v_EE[0] <> 2 Then $v_Check = 0 If UBound($v_Reg) <> UBound($v_Reg_Old) Then $v_Check = 1 Else For $i = 0 To UBound($v_Reg) - 1 If $v_Reg[$i] <> $v_Reg_Old[$i] Then $v_Check = 1 Next EndIf If $v_Check = 1 Then GUICtrlSetData($h_Out, "") If UBound($v_Reg) Then For $i = 0 To UBound($v_Reg) - 1 GUICtrlSetData($h_Out, $i & ' = ' & $v_Reg[$i]) Next Else GUICtrlSetData($h_Out, $v_Reg) EndIf EndIf EndIf $v_Reg_Old = $v_Reg StringRegExp('', Random(0x80000000, 0x7FFFFFFF), 1) EndFunc ;==>_Valid Func _Option() Switch $GUI_CHECKED Case GUICtrlRead($h_Radio_0) Return 0 Case GUICtrlRead($h_Radio_1) Return 1 Case GUICtrlRead($h_Radio_3) Return 3 EndSwitch EndFunc ;==>_Option1 point -
Gui Banner examples
MovieScreener2013 reacted to careca for a topic
When it's doing it's thing, you cant stop it, unless you have checks under every line. Even if you set a hotkey, it'll only activate once it has exited the function. When do you want to exit?0 points