Leaderboard
Popular Content
Showing content with the highest reputation on 12/11/2017 in all areas
-
Unpopular opinion: Self signing is not worth any less, because the value of EV certs is zero. It’s the cyber equivalent of rating lipsticks. I’ll take a proper PKI and app whitelisting before I place any checks for signatures.2 points
-
CompileIt - an experimental AutoIt-to-machine code compiler
Dotaznik reacted to scintilla4evr for a topic
Okay, this is exciting. I'm proud to introduce CompileIt - an experimental compiler, that allows to compile AutoIt to machine code. ...Kind of. CompileIt does compilation in a similar way the Glasgow Haskell compiler does: translates the code into a lower-level language (in CompileIt's case it's C), and then compiles the code in that language. Now, this project is still in its infancy, since, although it is simple to use, AutoIt is incredibly complex on the inside (automation, COM, etc.). So, CompileIt can compile only a very small subset of what we know as AutoIt. Here's a list of things CompileIt (partially) supports (or not): Numbers, booleans, strings Some built-in functions If, For and While statements Exporting DLL functions (you can now write DLL's in AutoIt, guys!) No arrays, automation, GUI or COM. A more detailed list is included with CompileIt. CompileIt is written in AutoIt (the compiler interface), JavaScript (parser, executed with ChakraCore), and of course C. GCC is required to compile scripts. After you extract the files, run CompileIt.exe and configure it to work with GCC.1 point -
Just define an GUICtrlSetOnEvent() for the button like the other buttons and put the logic for in it its own Func. Jod1 point
-
PixelGetColor with win10
toto22 reacted to ViciousXUSMC for a topic
Colors are fine for me on Win10. Check you scaling make sure its set to 100%1 point -
sleep program until a process is complete
Earthshine reacted to junkew for a topic
It basically starts in faq31 where the spying tools are explained to see if you can recognize the objects Check with spying tools and if recognized use the relevant commands Use alternatives Click by percentage offset of your window Use imagesearch / findbmp use pixelchecksum / pixelsearch use monitoring of cpu use ocr solutions like tesseract ....1 point -
Drag child gui with parent
Miliardsto reacted to Melba23 for a topic
Miliardsto, How about this: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $hGUI = GUICreate("Test", 500, 500, -1, -1) $cButton_0 = GUICtrlCreateButton("Child 0", 10, 10, 80, 30) $cButton_1 = GUICtrlCreateButton("Child 1", 10, 50, 80, 30) $cButton_2 = GUICtrlCreateButton("Child 2", 10, 90, 80, 30) GUISetState(@SW_SHOW, $hGUI) ; guis Global $hChild_[3] Global $countGUI = UBound($hChild_) - 1 Global $gui = 0 $hChild_[0] = GUICreate("Child 0", 350, 300, 150, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) GUISetBkColor(0xFF0000) GUISetState(@SW_SHOW, $hChild_[0]) ; Get difference in position of main and child GUIs $aMainPos = WinGetPos($hGUI) $aChildPos = WinGetPos($hChild_[0]) Global $iDiff_X = $aMainPos[0] - $aChildPos[0] Global $iDiff_Y = $aMainPos[1] - $aChildPos[1] $hChild_[1] = GUICreate("Child 1", 350, 300, 150, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) GUISetBkColor(0x00FF00) GUISetState(@SW_HIDE, $hChild_[1]) $hChild_[2] = GUICreate("Child 2", 350, 300, 150, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) GUISetBkColor(0x0000FF) GUISetState(@SW_HIDE, $hChild_[2]) GUIRegisterMsg($WM_NCHITTEST, "_NCHITTEST") GUIRegisterMsg($WM_MOVE, "_WM_MOVE") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton_0 _All_Hide() GUISetState(@SW_SHOW, $hChild_[0]) $gui = 0 Case $cButton_1 _All_Hide() GUISetState(@SW_SHOW, $hChild_[1]) $gui = 1 Case $cButton_2 _All_Hide() GUISetState(@SW_SHOW, $hChild_[2]) $gui = 2 EndSwitch WEnd Func _All_Hide() GUISetState(@SW_HIDE, $hChild_[0]) GUISetState(@SW_HIDE, $hChild_[1]) GUISetState(@SW_HIDE, $hChild_[2]) EndFunc Func _NCHITTEST($hWnd, $iMsg, $wParam, $lParam) For $i = 0 To $countGUI If $hWnd = $hChild_[$i] Then Local $aPos = WinGetPos($hWnd) If Abs(BitAND(BitShift($lParam, 16),0xFFFF)- $aPos[1]) < 500 Then Return $HTCAPTION ExitLoop EndIf Next Return $GUI_RUNDEFMSG EndFunc Func _WM_MOVE($hWnd, $iMsg, $wParam, $lParam) For $i = 0 To $countGUI If $hWnd = $hChild_[$i] Then ; Get child position Local $aPos = WinGetPos($hWnd) ; Adjust main GUI position WinMove($hGUI, "", $aPos[0] + $iDiff_X, $aPos[1] + $iDiff_Y) ExitLoop EndIf Next EndFunc M231 point -
Batman22, Here it is in all it's ridiculous glory... #include <sqlite.au3> #include <array.au3> ; start sqlite with a temp DB _SQLite_Startup() _SQLite_Open() OnAutoItExitRegister('_fini') Local $ret = _SQLite_Exec(-1, 'CREATE TABLE if not exists [t1] (c1, c2);') If $ret <> $SQLITE_OK Then Exit (MsgBox(0, 'SQLITE ERROR', 'Create Temp Table Failed')) ; load temp table t1 Local $aFile = StringSplit(FileRead(@ScriptDir & '\samplefile.txt'), @CRLF, 3), $sql = 'insert into t1 values ' For $1 = 0 To UBound($aFile) - 1 If $aFile[$1] = '' Then ContinueLoop $sql &= '(' & _SQLite_FastEscape(StringRegExpReplace($aFile[$1], '(.*?) .*', '$1')) & ', ' & _SQLite_FastEscape(StringRegExpReplace($aFile[$1], '.*? (.*)', '$1')) & '),' & @CRLF Next $sql = StringTrimRight($sql, 3) & ';' _SQLite_Exec(-1, $sql) If @error Then Exit MsgBox(0, '', _SQLite_ErrMsg()) ; get rid of dup entries...stor result in table t2 Local $ret = _SQLite_Exec(-1, 'CREATE TABLE t2 AS SELECT distinct * FROM t1; drop table t1') If $ret <> $SQLITE_OK Then Exit (MsgBox(0, 'SQLITE ERROR', 'Create Final Table Failed')) ; retrieve entries ordered by column 1 desc within column 2 asc Local $ret, $arows, $irows, $icols _SQLite_GetTable2d(-1, 'select * from t2 order by c2, c1 desc;', $arows, $irows, $icols) _ArrayDisplay($arows, 'Before flip') ; flip LCSD with LCS rows Local $tleft, $tright For $1 = 0 To UBound($arows) - 1 If StringLeft($arows[$1][0], 4) = 'LCSD' Then $tleft = $arows[$1][0] $tright = $arows[$1][1] $arows[$1][0] = $arows[$1 + 1][0] $arows[$1][1] = $arows[$1 + 1][1] $arows[$1 + 1][0] = $tleft $arows[$1 + 1][1] = $tright $1 += 1 EndIf Next _ArrayDisplay($arows, 'After flip') Func _fini() _SQLite_Shutdown() Exit EndFunc ;==>_fini kylomas1 point
-
Batman22, The easiest way that I know of to sort columns within columns is thru a DB engine like this... #include <sqlite.au3> #include <array.au3> ; start sqlite with a temp DB _SQLite_Startup() _SQLite_Open() OnAutoItExitRegister('_fini') Local $ret = _SQLite_Exec(-1, 'CREATE TABLE if not exists [t1] (c1, c2);') If $ret <> $SQLITE_OK Then Exit (MsgBox(0, 'SQLITE ERROR', 'Create Temp Table Failed')) ; load temp table t1 Local $aFile = StringSplit(FileRead(@ScriptDir & '\samplefile.txt'), @CRLF, 3), $sql = 'insert into t1 values ' For $1 = 0 To UBound($aFile) - 1 If $aFile[$1] = '' Then ContinueLoop $sql &= '(' & _SQLite_FastEscape(StringRegExpReplace($aFile[$1], '(.*?) .*', '$1')) & ', ' & _SQLite_FastEscape(StringRegExpReplace($aFile[$1], '.*? (.*)', '$1')) & '),' & @CRLF Next $sql = StringTrimRight($sql, 3) & ';' _SQLite_Exec(-1, $sql) If @error Then Exit MsgBox(0, '', _SQLite_ErrMsg()) ; get rid of dup entries...stor result in table t2 Local $ret = _SQLite_Exec(-1, 'CREATE TABLE t2 AS SELECT distinct * FROM t1; drop table t1') If $ret <> $SQLITE_OK Then Exit (MsgBox(0, 'SQLITE ERROR', 'Create Final Table Failed')) ; retrieve entries ordered by column 1 desc within column 2 asc Local $ret, $arows, $irows, $icols _SQLite_GetTable2d(-1, 'select * from t2 order by c2, c1 desc;', $arows, $irows, $icols) _ArrayDisplay($arows) Func _fini() _SQLite_Shutdown() Exit EndFunc ;==>_fini This uses an SQLite dll. If you don't have it you can download it from here. Stick it in any of the WIN standard load libs or specify the path to the dll in the _SQLite_startup function. Make sure you get the right version (32 or 64 bit). kylomas1 point
-
don't understand how to use ControlSend
Earthshine reacted to careca for a topic
It is possible yes, you drag the info tool into the control and see if it gives you an ID, some applications dont, but there are other methods, check the link in my signature.1 point -
Well, as far as I can tell you were asked what information you are posting and all you state is that you need help to bump the thread. So what about trying to type some words here to explain all the posted information? Jos1 point
-
Batman22, This looks like all you need... #include <Array.au3> Local $str = FileRead(@ScriptDir & '\samplefile.txt') ;_arraydisplay(_DBG_StringSplit2D($str, " "),'String Converted to 2D Array') Local $SortMe = _DBG_StringSplit2d($str, " ") _ArraySort($SortMe, 0, 0, 0, 1) ;_ArrayDisplay($SortMe, "2D'd and Sorted!") Local $hfl = FileOpen(@ScriptDir & '\parsed log.txt', 2), $outstr = '' For $1 = 0 To UBound($SortMe) - 1 For $2 = 0 To UBound($SortMe, 2) - 1 $outstr &= $SortMe[$1][$2] & ' ' Next $outstr &= @CRLF Next FileWrite($hfl, $outstr) FileClose($hfl) ShellExecute(@ScriptDir & '\parsed log.txt') Func _DBG_StringSplit2d(ByRef $str, $delimiter) ; #FUNCTION# ====================================================================================== ; Name ................: _DBG_StringSplit2D($str,$delimiter) ; Description .........: Create 2d array from delimited string ; Syntax ..............: _DBG_StringSplit2D($str, $delimiter) ; Parameters ..........: $str - EOL (@CR, @LF or @CRLF) delimited string to split ; $delimiter - Delimter for columns ; Return values .......: 2D array ; Author ..............: kylomas ; ================================================================================================= Local $a1 = StringSplit($str, @CRLF, 3), $a2 ;local $a1 = stringregexp($str,'.*?(?:\R|$)',3), $a2 Local $rows = UBound($a1) - 1, $cols = 0 ; determine max number of columns by splitting each row and keeping highest ubound value For $i = 0 To UBound($a1) - 1 $a2 = StringSplit($a1[$i], $delimiter, 1) If UBound($a2) > $cols Then $cols = UBound($a2) Next ; define and populate array Local $aRET[$rows][$cols - 1] For $i = 0 To $rows - 1 $a2 = StringSplit($a1[$i], $delimiter, 3) For $j = 0 To UBound($a2) - 1 $aRET[$i][$j] = $a2[$j] Next Next Return $aRET EndFunc ;==>_DBG_StringSplit2d kylomas1 point
-
Adamguy, Welcome to the AutoIt forums. The problem is caused by you transposing the array as you display it. The internal logic of the UDF says that if you transpose the array then the columns are now rows and so the headers are no longer required. So you need to transpose your array before you display it: #include <Array.au3> Global $aArray[][] = [["Title 1", "Title 2", "Title 3", "Title 4"], _ ["User 1", "User 2", "User 3", "User 4"], _ ["Descript 1", "Descript 2", "Descript 3", "Descript 4"]] Local $heading = "Job Title | AffectedUser | Description | DateCreated " Local $iflags = 64 ; Do not add the transpose flag here _ArrayTranspose($aArray) _ArrayDisplay($aArray, "Jobs Logged", Default, $iflags, Default, $heading) M231 point
-
CodeCrypter - Encrypt your Script
Miliardsto reacted to RTFC for a topic
CodeCrypter is a front-end for my MCF library. It can perform a variety of functions, which is why it supports many different options. But a number of "presets" is provided that enable-1-click settings for ease of use. More specifically regarding your questions: If you wish to protect your script, translation is irrelevant, as this is for translating your GUI strings, user messages, and labels into different languages. So do not tick any checkboxes under "Translate." Obfuscation is similar to translation, in that it replaces variable- and/or function names with long hexadecimal strings that are difficult to read for humans. As Jos already pointed out, obfuscation does not protect your script, it just makes understanding what goes on a bit harder for people trying to analyse the code. So you can leave those checkboxes unticked as well. Under the Tab "Encrypt" I would suggest you tick "Phrases" and "Strings" only; you can also leave "Strings" unticked, then your code will execute faster (fewer decryption calls), but all text strings will then be legible (unchanged) in the encrypted version of your script. Forget about subsets (encrypting only parts of your script) and indirection (more slowdown, but makes it harder for hackers to analyse) for now. Do not Shuffle multiple keys either, start by using a single key. Under Tab "Structure" activate only "Enable Phrasing." IMPORTANT: before you start CodeCrypter, you first have to: study the $CCkey definitions in function _MCFCC_Init() in MCFinclude.au3 (ca. line 200) to decide which key your script will be using for en/decryption. The $CCkey array index = numeric key ID in CodeCrypter (under Tab "Encrypt"). For example, by default, key 2 = whatever macro @computername returns, key 3 = whatever macro @username returns, key 4 = whatever your motherboard hardware returns as ID, etcetera. You can replace these with your own definitions as you see fit. #include MCFinclude.au3 in your script (below your other includes, but above your own code) run CodeScanner to produce the MCF files for your script (so CodeCrypter knows what is what) The underlying idea is that anyone can copy your encrypted script, but it will use whatever the environment returns locally as decryption key, producing garbage unless it matches whatever the script was encrypted with.1 point -
1 point
-
Which Monitor is a Window On?
coffeeturtle reacted to tcurran for a topic
Given a specific XY coordinate, this snippet returns the handle to the monitor the coordinate appears on... or 0 if it is off all screens. Particularly useful in multiple monitor setups where monitors have different resolutions or are offset vertically or horizontally (in which case, there are areas of the virtual desktop that are off all screens). You could also use it to return the handle of the monitor where a window is placed, or where the mouse was clicked, or other similar applications. #include <WinAPIGdi.au3> ;for _WinOnMonitor() Func _WinOnMonitor($iXPos, $iYPos) Local $aMonitors = _WinAPI_EnumDisplayMonitors() If IsArray($aMonitors) Then ReDim $aMonitors[$aMonitors[0][0] + 1][5] For $ix = 1 To $aMonitors[0][0] $aPos = _WinAPI_GetPosFromRect($aMonitors[$ix][1]) For $j = 0 To 3 $aMonitors[$ix][$j + 1] = $aPos[$j] Next Next EndIf For $ixMonitor = 1 to $aMonitors[0][0] ; Step through array of monitors If $iXPos > $aMonitors[$ixMonitor][1] And $iXPos < $aMonitors[$ixMonitor][1] + $aMonitors[$ixMonitor][3] Then If $iYPos > $aMonitors[$ixMonitor][2] And $iYPos < $aMonitors[$ixMonitor][2] + $aMonitors[$ixMonitor][4] Then Return $aMonitors[$ixMonitor][0] ; return handle to monitor coordinate is on EndIf EndIf Next Return 0 ;Return 0 if coordinate is on none of the monitors EndFunc ;==> _WinOnMonitor1 point -
Hi, Enough of flogging the same old horse - it never, ever comes back to life. For the umpteenth time: AutoIt is Jon's project and the release of any new version depends on his willingness to take time away from getting food on his table and a roof over his head to do the required development work - just remind yourself that he makes absolutely nothing from you and all the others who use Autoit. The whole AutoIt project is a hobby for the non-existent "AutoIt coding team" and those of us who do help out both here in the forum and as core UDF maintainers do so as volunteers solely for the pleasure of helping others. If you want an IDE, debugger, etc then go ahead and code it yourself - or pay someone else to do so - as there is zero chance of seeing "official" versions. Thread closed. As indeed will be any future ones on this subject - because they all end up the same way with people demanding that their own personal coding requirements are provided free of charge by others. M231 point