Leaderboard
Popular Content
Showing content with the highest reputation on 06/02/2016 in all areas
-
This script allows you to 'browse' an array and view it's content. It's similar to the _ArrayDisplay() command, but this one has no limit on the number of dimensions. Nested array (array of arrays) are also allowed. (I'm been inspired by this @JohnOne's Post) Since multidimensional arrays can be considered as many bidimensional arrays grouped toghether, with this script you can view any of the many 2d arrays by selecting the dimension (the sheet number) you want to see through the ComboBoxes located at the top of the viewed sheet. regarding the arrays of array, if are present, those are listed on the treeview on the left side, where you can see their locations within the tree, and easily selected to be as well browsed by a click. I'm aware that there is a wide margin of aesthetic improvement, anyway the basic functionality works quite well. I hope it can be usefull ; Func _ArrayView() ; Will display content of arrays of any dimension, and even nested arrays if any ; #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #include <GUITreeView.au3> #include <GUIScrollBars.au3> #include <ScrollBarConstants.au3> #include <ComboConstants.au3> #include <GuiStatusBar.au3> ; -- build an example array (somewhat chaotic.. just to show something) -- ; 4D array (main array) Local $aA[10][5][6][3] For $d1 = 0 To 9 For $d2 = 0 To 4 For $d3 = 0 To 5 For $d4 = 0 To 2 $aA[$d1][$d2][$d3][$d4] = $d1 & "." & $d2 & "." & $d3 & "." & $d4 Next Next Next Next ; some 1D arrays with multi nested arrays Local $aMonths1 = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] Local $aMonths2 = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", $aMonths1] Local $aMonths3 = ["Sijecanj", "veljaca", "ožujka", "travanj", "Svibanj", "lipanj", "srpanj", "kolovoz", "rujan", "listopad", "studeni", "prosinac", $aMonths2] Local $aMonths4 = ["Janvier", "Février", "Mars", "Avril", "mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre", $aMonths3] Local $aMonths5 = ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'giu', 'Luglio', 'Agosto', 'Settembre', 'ottobre', 'Novembre', 'Dicembre', $aMonths4] Local $aMonths = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", $aMonths5] ; a simple 2D array Local $aWeekdays = [['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'], _ ['Lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato', 'domenica'], _ ['Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi', 'Dimanche'], _ ['Måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag', 'söndag'], _ ['Poniedziałek', 'Wtorek', 'Środa', 'Czwartek', 'Piątek', 'Sobota', 'Niedziela'], _ ['Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag']] ; array $aMonths goes in cell [5][3] dimension [0][0] of main array $aA[5][3][0][0] = $aMonths ; array $aWeekdays goes in cell [6][3] dimension [0][0] of main array $aA[6][3][0][0] = $aWeekdays $aWeekdays[1][1] = $aWeekdays ; self nest $aWeekdays in cell [1][1] $aA[9][4][0][1] = $aWeekdays ; new $aWeekdays goes in cel [9][4] dimension [0][1] of main array _ArrayView($aA) ; show main array ; #FUNCTION# ==================================================================================================================== ; Name ..........: _ArrayView ; Description ...: Allows to view content of amono or multidimensional array. Array of arrays are also allowed ; Syntax ........: _ArrayView(Byref $_aInput) ; Parameters ....: $_aInput - The array that you want to 'Browse' ; Return values .: on success returns 1 ; on faillure returns 0 and set @Error to 1 (passed argument is not an array) ; Author ........: @Chimp ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _ArrayView(ByRef $_aInput) If Not IsArray($_aInput) Then Return SetError(1, 0, 0) ; if error set @Error and return 0 Local $iGUIwidth = 900 Local $iGUIheight = 600 Local $iTreeWidth = 150 Local $iCombosZone = 60 Local $hGui = GUICreate("Array viewer", $iGUIwidth, $iGUIheight) Local $StatusBar = _GUICtrlStatusBar_Create($hGui), $iStatusBarheight = 23 Local $aSubscripts[64][4] ; It holds IDs of controls ; - creates all ComboBox in an embedded window. All controls are hidden at startup. ; - Only the necessary combo will be shown at run time. One combo for each dimension Local $hSubscriptSelectors = GUICreate('', $iGUIwidth - $iTreeWidth - 6, $iCombosZone - 2, $iTreeWidth + 4, 2, BitOR($WS_CHILD, $WS_HSCROLL), -1, $hGui) ; GUISetBkColor(0xEEFFEE) For $i = 0 To 63 ; Create the labels $aSubscripts[$i][0] = GUICtrlCreateLabel('D' & $i + 1, ($i * 60) + 8, 1) GUICtrlSetFont(-1, 10, 0, 0, "Courier new") GUICtrlSetState(-1, $GUI_HIDE) ; Labels will be hidden at startup. $aSubscripts[$i][1] = GUICtrlCreateLabel('[', ($i * 60), 18) GUICtrlSetFont(-1, 13, 800) GUICtrlSetState(-1, $GUI_HIDE) $aSubscripts[$i][3] = GUICtrlCreateLabel(']', ($i * 60) + 50, 18) GUICtrlSetFont(-1, 13, 800) GUICtrlSetState(-1, $GUI_HIDE) Next For $i = 0 To 63 ; Create the ComboBox (creates separatelly from labels so that ControlIDs of ComboBaxes has it's own sequence) GUICtrlSetState(-1, $GUI_HIDE) ; ComboBox will be hidden at startup. If $i < 2 Then ; all the content of the first 2 dimensions is already shown in the listview (no need of ComboBox) $aSubscripts[$i][2] = GUICtrlCreateCombo("---", ($i * 60) + 8, 17, 40, -1, $CBS_DROPDOWNLIST) GUICtrlSetState(-1, $GUI_DISABLE) Else $aSubscripts[$i][2] = GUICtrlCreateCombo("0", ($i * 60) + 8, 17, 40, -1, $CBS_DROPDOWNLIST) EndIf GUICtrlSetFont(-1, 8, 800) GUICtrlSetState(-1, $GUI_HIDE) ; ComboBox hidden at startup. Next GUISwitch($hGui) ; back to main window ; Create the TreeView structure $hTree = GUICtrlCreateTreeView(2, 2, $iTreeWidth - 2, $iGUIheight - 4 - $iStatusBarheight, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE) Local $hRoot = _GUICtrlTreeView_Add($hTree, 0, "Root") ; first insert the root key in treeview _ArrayTraverse($_aInput, $hTree, $hRoot) ; Search for SubArrays (array in array) ; Create the ListView Local $idListview = GUICtrlCreateListView('', $iTreeWidth + 2, $iCombosZone + 2, $iGUIwidth - $iTreeWidth - 4, $iGUIheight - $iCombosZone - 4 - $iStatusBarheight, Default, BitOR($LVS_EX_DOUBLEBUFFER, $LVS_EX_GRIDLINES)) ; If Array has many dimensions, and so all ComboBoxes doesn't fit in window, this allows to scroll GUIRegisterMsg($WM_HSCROLL, "WM_HSCROLL") _GUIScrollBars_Init($hSubscriptSelectors, 60 * UBound($_aInput, 0), 0) GUISetState(@SW_SHOW, $hGui) GUISetState(@SW_SHOW, $hSubscriptSelectors) ; Main Loop until the user exits. ; ------------------------------- Local $sLastWholeKey, $sWholeKey, $vContent, $bRebuild While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE GUIDelete($hGui) ExitLoop Case $aSubscripts[2][2] To $aSubscripts[63][2] ; some ComboBox has changed _ArrayDisplayByLayer($vContent, $idListview, $aSubscripts, False) EndSwitch ; $sWholeKey = _GUICtrlTreeView_GetTree($hTree, _GUICtrlTreeView_GetSelection($hTree)) If $sLastWholeKey <> $sWholeKey Then ; clicked on a new KeyPath or (again) on the one already selected? GUISetCursor(15, 1) ; set cursor to "wait" ; Adapt the TreePath to the array access syntax $sElement = _TreePathParser($sWholeKey) ; address of main array or subarray to peek _GUICtrlStatusBar_SetText($StatusBar, StringReplace($sWholeKey, '|', '->') & ' --> ' & $sElement) ; show the 'address' of selected element on statusbar $vContent = Execute(_TreePathParser($sWholeKey)) _ArrayDisplayByLayer($vContent, $idListview, $aSubscripts, True) _GUICtrlTreeView_ClickItem($hTree, _GUICtrlTreeView_GetSelection($hTree)) $sLastWholeKey = $sWholeKey ; keep track of already clicked KeyPath so we will not redraw the same Array if clicked again GUISetCursor() ; cursor back to default EndIf ; WEnd Return SetError(0, 0, 1) ; if no errors return 1 EndFunc ;==>_ArrayView Func _ArrayDisplayByLayer(ByRef $_aInput, ByRef $idListview, ByRef $aSubscripts, $bRebuild = False) Opt('GUIOnEventMode', 1) ; Disable GUIGetMsg() so is not fired while redrawing ComboBoxes. Local $sTarghet = '$_aInput[$y]' Local $iDimensions = UBound($_aInput, 0) Local $iRows = UBound($_aInput, 1) Local $iColumnsCount, $iColumns = UBound($_aInput, 2) Local $sSubscripts = '' ; Clear the ListView _GUICtrlListView_DeleteAllItems($idListview) If $bRebuild Then ; (Re)Create the ListView $iColumnsCount = _GUICtrlListView_GetColumnCount($idListview) If $iColumnsCount Then For $i = $iColumnsCount To 1 Step -1 _GUICtrlListView_DeleteColumn($idListview, $i - 1) Next EndIf ; Hide and clear all ComboBox For $i = 0 To 63 GUICtrlSetState($aSubscripts[$i][0], $GUI_HIDE) ; Header GUICtrlSetState($aSubscripts[$i][1], $GUI_HIDE) ; '[' GUICtrlSetState($aSubscripts[$i][2], $GUI_HIDE) ; ComboBox Handle GUICtrlSetData($aSubscripts[$i][2], '') ; clear ComboBox items GUICtrlSetState($aSubscripts[$i][3], $GUI_HIDE) ; ']' Next ; (Re)Build the ListView's frame If $iDimensions = 1 Then $iColumns = 1 Else $iColumns = UBound($_aInput, 2) ; nr. of columns in the ListView (second dimension) $sTarghet &= '[$x]' EndIf _GUICtrlListView_AddColumn($idListview, 'Row') For $i = 1 To $iColumns _GUICtrlListView_AddColumn($idListview, 'Col ' & $i - 1, 100) Next For $i = 0 To $iDimensions - 1 ; Show only necessary ComboBox (one for each dimension) GUICtrlSetState($aSubscripts[$i][0], $GUI_SHOW) ; Header GUICtrlSetState($aSubscripts[$i][1], $GUI_SHOW) ; '[' GUICtrlSetState($aSubscripts[$i][2], $GUI_SHOW) ; ComboBox Handle GUICtrlSetState($aSubscripts[$i][3], $GUI_SHOW) ; ']' If $i > 1 Then $sTarghet &= '[0]' ; dimensions over the second all setting to 0 (begin showing first lyer) $sSubscripts = "" For $iSubscript = 0 To UBound($_aInput, $i + 1) - 1 $sSubscripts &= $iSubscript & '|' Next GUICtrlSetData($aSubscripts[$i][2], StringTrimRight($sSubscripts, 1)) ControlFocus('', '', $aSubscripts[$i][2]) ControlSend('', '', $aSubscripts[$i][2], 0) EndIf Next Else ; Just refill the listview with data from the Array dimension selected by ComboBoxes ; Create the 'dimension' string $sTarghet &= '[$x]' For $i = 2 To $iDimensions - 1 $sTarghet &= '[' & GUICtrlRead($aSubscripts[$i][2]) & ']' Next $iColumns = UBound($_aInput, 2) EndIf For $y = 0 To $iRows - 1 GUICtrlCreateListViewItem('', $idListview) _GUICtrlListView_SetItemText($idListview, $y, '[' & $y & ']', 0) ; row number For $x = 0 To $iColumns - 1 $vCellContent = Execute($sTarghet) If IsArray($vCellContent) Then _GUICtrlListView_SetItemText($idListview, $y, '{array}', $x + 1) Else _GUICtrlListView_SetItemText($idListview, $y, $vCellContent, $x + 1) EndIf Next Next Opt('GUIOnEventMode', 0) ; reenable GUIGetMsg() EndFunc ;==>_ArrayDisplayByLayer Func _ArrayTraverse(ByRef $aMyArray, ByRef $hTree, $hParent) #cs since this is a recursive Function, the same Func runs many times, self called from within itself. The variables declared as Global at the top of the script are able to be accessed from any instance of the function, whereas the variable declared (as Local) within the function may be different for each instance of the function. #ce If Not IsArray($aMyArray) Then Return SetError(1, 0, -1) ; we have to know how many nested for-next loops we need ; that is one loop for each dimension Local $iDimensions = UBound($aMyArray, 0) ; number of nested for-next loops Local $sArrayPointer = "$aMyArray", $sElement For $i = 0 To $iDimensions - 1 $sArrayPointer &= '[$aLoops[' & $i & '][2]]' Next ; ----------------------------------------------------------------------------------- ; This is a nested For-Next loops simulator with variable depth of nested loops ; pass a 2D zero based array[n][3] ; with as many records as nested loops needed ; as following: ; ; Example; For $i = start To end ; ----- --- ; [n][0] = Start value ; [n][1] = End value ; [n][2] = actual loop counter (at startup is = to Start value [n][0]) ; ; --- Initializes custom nested For-Next loops -------------------------------------- Local $aLoops[$iDimensions][3] ; nr of nested loops is $iDimensions For $i = 0 To $iDimensions - 1 $aLoops[$i][0] = 0 ; Start value $aLoops[$i][1] = UBound($aMyArray, $i + 1) - 1 ; End value $aLoops[$i][2] = $aLoops[$i][0] ; actual loop counter Next ; ----------------------------------------------------------------------------------- Local $x, $vContent Do $vContent = Execute($sArrayPointer) If IsArray($vContent) Then ; here there is a Nested array, populate the TreeView with a child element $sElement = "" For $i = 0 To $iDimensions - 1 $sElement &= '[' & $aLoops[$i][2] & ']' Next Local $hNode = _GUICtrlTreeView_AddChild($hTree, $hParent, $sElement) ; recursive call for this nested array to search if there are any further nested arrays _ArrayTraverse($vContent, $hTree, $hNode) ; <-- recursive call EndIf ; ------------------------------------------------------------------------------- $x = UBound($aLoops) - 1 $aLoops[$x][2] += 1 While ($aLoops[$x][2] > $aLoops[$x][1]) ; check if and which nested loops are out of bound $aLoops[$x][2] = $aLoops[$x][0] ; reset the counter of this loop ($x) $x -= 1 ; check next outer nest If $x < 0 Then ExitLoop ; if we have finished all nested loops then Exit $aLoops[$x][2] += 1 ; when a deeper loop complete, increment the outer one WEnd Until $x < 0 ; If no more nested loops then exit EndFunc ;==>_ArrayTraverse ; Tree Path to Subscript Func _TreePathParser($Input) Local $sReturn = '$_aInput' Local $aSubArrays = StringSplit($Input, '|', 3) If UBound($aSubArrays) > 1 Then For $i = 1 To UBound($aSubArrays) - 1 $sReturn &= $aSubArrays[$i] If $i < UBound($aSubArrays) - 1 Then $sReturn = '(' & $sReturn & ')' Next EndIf Return $sReturn EndFunc ;==>_TreePathParser ; this will allow the scrolling of window containing ComboBoxes (if number of Combo doesn't fit in window) ; see _GUIScrollBars_Init() in the Help of AutoIt Func WM_HSCROLL($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $lParam Local $iScrollCode = BitAND($wParam, 0x0000FFFF) Local $iIndex = -1, $iCharX, $iPosX Local $iMin, $iMax, $iPage, $iPos, $iTrackPos For $x = 0 To UBound($__g_aSB_WindowInfo) - 1 If $__g_aSB_WindowInfo[$x][0] = $hWnd Then $iIndex = $x $iCharX = $__g_aSB_WindowInfo[$iIndex][2] ExitLoop EndIf Next If $iIndex = -1 Then Return 0 ; ; Get all the horizontal scroll bar information Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_HORZ) $iMin = DllStructGetData($tSCROLLINFO, "nMin") $iMax = DllStructGetData($tSCROLLINFO, "nMax") $iPage = DllStructGetData($tSCROLLINFO, "nPage") ; Save the position for comparison later on $iPosX = DllStructGetData($tSCROLLINFO, "nPos") $iPos = $iPosX $iTrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos") #forceref $iMin, $iMax Switch $iScrollCode Case $SB_LINELEFT ; user clicked left arrow DllStructSetData($tSCROLLINFO, "nPos", $iPos - 1) Case $SB_LINERIGHT ; user clicked right arrow DllStructSetData($tSCROLLINFO, "nPos", $iPos + 1) Case $SB_PAGELEFT ; user clicked the scroll bar shaft left of the scroll box DllStructSetData($tSCROLLINFO, "nPos", $iPos - $iPage) Case $SB_PAGERIGHT ; user clicked the scroll bar shaft right of the scroll box DllStructSetData($tSCROLLINFO, "nPos", $iPos + $iPage) Case $SB_THUMBTRACK ; user dragged the scroll box DllStructSetData($tSCROLLINFO, "nPos", $iTrackPos) EndSwitch ; // Set the position and then retrieve it. Due to adjustments ; // by Windows it may not be the same as the value set. DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS) _GUIScrollBars_SetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO) _GUIScrollBars_GetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO) ;// If the position has changed, scroll the window and update it $iPos = DllStructGetData($tSCROLLINFO, "nPos") If ($iPos <> $iPosX) Then _GUIScrollBars_ScrollWindow($hWnd, $iCharX * ($iPosX - $iPos), 0) Return $GUI_RUNDEFMSG EndFunc ;==>WM_HSCROLL2 points
-
Version 1.6.3.0
17,290 downloads
Extensive library to control and manipulate Microsoft Active Directory. Threads: Development - General Help & Support - Example Scripts - Wiki Previous downloads: 30467 Known Bugs: (last changed: 2020-10-05) None Things to come: (last changed: 2020-07-21) None BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort1 point -
BugFix version - 27 Dec 23 Fixed: No default value set for the MaxWidth parameter - took 12 years for someone to notice it! New UDF and new examples below and in zip. I just realised that although I have posted versions of this UDF many times in Help topics, I had never actually posted a "final" version here in Example scripts - better late than never, I suppose! StringSize takes a text string and calculates the size of label required to hold it as well as formatting the string to fit. Now AutoIt will, of course, size a label automatically to fit a text string, but it will not format the string in any way - what you use as the string is what you get in the label. If you do set any label sizes the text will be wrapped, but you can only determine the correct size of the label by trial and error. StringSize will, however, reformat the string to fit in a given width and tell you the required height so that you can read it all - whatever the font type or size - and you do not have to do the formatting beforehand. Here is a simple example to show what I mean (you need the UDF in the same folder for all the examples): And here is an example showing how StringSize can deal with different fonts and text sizes: You can see that the GUI is perfectly sized each time and that the button is always the right size and in the right place. StringSize returns an array which contains the formatted text to display and the size of the label needed to display it. All you need to do is to use the array elements when you create your label. Try changing the values in $aFont and $aSize if you want to try you own favourites - but beware, StringSize will return an error if you make the size so large that it cannot fit a word into the label width. NEW A more complex example showing how formatted and unformatted text can be sized correctly. The width of GUI holding the unformatted text varies randomly in width (the current value is displayed at top right): NEW And a final example showing how you can get your text in the largest possible font to fit in a given space: Finally here is the UDF itself: And all 5 files in zip format: StringSize.zip I hope you find this useful - I certainly do. M231 point
-
_WinTrust.au3
falcontechnics reacted to kasty for a topic
This script makes use of WinTrust.dll and Crypt32.dll to: - verify the integrity of a file with its embedded signature or a given catalog (based on the work of progandy http://www.autoit.de/index.php?page=Thread&postID=68477#post68477) - determine the serial number, owner and issuer of the certificate used by the signature (developed by Kasty, based on C++ examples from MSDN) It allows to specify paths in any codepage (inspect .au3 file for more information). Example 1: $filePath = ".signed.exe"$ signed = False If _WinVerifyTrust($filePath) = $ERROR_SUCCESS Then $signed = True ConsoleWrite($filepath & " is correctly signed = " & $signed & @LF) $certInfo = _GetSignatureInfo($filepath) ConsoleWrite("Serial Number: " & $certInfo[0] & @LF) ConsoleWrite("Owner: " & $certInfo[1] & @LF) ConsoleWrite("Issuer: " & $certInfo[2] & @LF) Example 2: If _WinVerifyTrust("test.zip", "test.cat", "File1") = $ERROR_SUCCESS Then $signed = True See other post below for more information on how to make catalogs to sign non-PE files. Regards. _WinTrust.au31 point -
This is a small UDF I put together just for fun that will embed and extract complete directory's in and from your script. It only has two functions, _EmbeddedDirectory_Create() and _EmbeddedDirectory_Extract(). The udf uses Wards machine code functions so they have pretty good speed. The example I set up packs all files located in Autoit Include directory. Both compression and decompression of the directory was less than 500ms on my pc which I was happy with. Let me if you have any problems or questions. Thanks Example: #include "EmbedDir.au3" ;Check location of autoit includes Global $sIncludeDir = 'C:\Program Files\AutoIt3\Include\' If Not FileExists($sIncludeDir) Then $sIncludeDir = 'C:\Program Files (x86)\AutoIt3\Include\' If Not FileExists($sIncludeDir) Then Exit (MsgBox(0, 'Directory Not Found', 'Unable to locate Includes Directory')) ;Create embedded directory function Global $sCompressed_Includes = _EmbeddedDirectory_Create($sIncludeDir, '_Extract_Includes') Global $iTime = (@extended / 1000) & ' ms' ;create example file and write extract function to it Global $hExtractExample = FileOpen(@ScriptDir & 'Extract_Example.au3', 2) FileWrite($hExtractExample, '#include "EmbedDir.au3"' & @LF & @LF & _ '$sExt = _Extract_Includes()' & @LF & _ '_EmbeddedDirectory_Extract($sExt, @ScriptDir & "AutoIt_Extracted")' & @LF & _ 'ConsoleWrite("Extract Time = " & @extended/1000 & "ms" & @LF)' & @LF & @LF & _ $sCompressed_Includes) FileClose($hExtractExample) ;Show stats of the directory we just embeded $aSize = DirGetSize($sIncludeDir,1) If IsArray($aSize) Then Msgbox(0,"Directory Details", _ "Size = " & Int($aSize[0]/1024) & 'KB' & @LF & _ "Files = " & $aSize[1] & @LF & _ "Dirs = " & $aSize[2] & @LF & _ "Compression time = " & $iTime & @LF & @LF & _ "Open Extract_Example.au3 to extract") EndIf UDF: EmbedDir.zip1 point
-
Telnet
eagle4life69 reacted to youtuber for a topic
#RequireAdmin _Wow64FsRedirection(False) Run("C:\Windows\System32\telnet.exe") _Wow64FsRedirection(True) Func _Wow64FsRedirection($state) ; Disables or reverts the filesystem redirector for a 32 bit process running on 64bit OS If Not @AutoItX64 And @OSArch = 'X64' Then If $state Then DllCall("kernel32.dll", "int", "Wow64RevertWow64FsRedirection", "int", 0) Else DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 0); or 1 as per help EndIf If @error Then Return SetError(1) EndIf EndFunc WinWait("[CLASS:ConsoleWindowClass]") WinActivate("[CLASS:ConsoleWindowClass]") WinWaitActive("[CLASS:ConsoleWindowClass]") Send("open 192.168.2.1{enter}") ;Send("quit{enter}")1 point -
this is one method Global $Form1 = GUICreate("Form1", 611, 430, 286, 158) GUISetOnEvent($GUI_EVENT_SECONDARYDOWN, "Your Function") Func Your Function() ;Call GUIGetCursorInfo function here ; And do the context menu works too here EndFunc1 point
-
Active Directory UDF - Help & Support (III)
OrangeCoder reacted to water for a topic
Or you could press the "Like this" button until your fingers fall off1 point -
woops stupid commen from my side. thanks works @kcvinu1 point
-
1 point
-
Hi @Sturmi , This is some sample code from help file. #include <GUIConstantsEx.au3> #include <GuiImageList.au3> #include <GuiListView.au3> #include <WindowsConstants.au3> Global $g_hListView Example() Func Example() Local $hGUI, $hImage $hGUI = GUICreate("(UDF Created) ListView Create", 400, 300) $g_hListView = _GUICtrlListView_Create($hGUI, "", 2, 2, 394, 268) _GUICtrlListView_SetExtendedListViewStyle($g_hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES)) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ; Load images $hImage = _GUIImageList_Create() _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($g_hListView, 0xFF0000, 16, 16)) _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($g_hListView, 0x00FF00, 16, 16)) _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($g_hListView, 0x0000FF, 16, 16)) _GUICtrlListView_SetImageList($g_hListView, $hImage, 1) ; Add columns _GUICtrlListView_InsertColumn($g_hListView, 0, "Column 1", 100) _GUICtrlListView_InsertColumn($g_hListView, 1, "Column 2", 100) _GUICtrlListView_InsertColumn($g_hListView, 2, "Column 3", 100) ; Add items _GUICtrlListView_AddItem($g_hListView, "Row 1: Col 1", 0) _GUICtrlListView_AddSubItem($g_hListView, 0, "Row 1: Col 2", 1) _GUICtrlListView_AddSubItem($g_hListView, 0, "Row 1: Col 3", 2) _GUICtrlListView_AddItem($g_hListView, "Row 2: Col 1", 1) _GUICtrlListView_AddSubItem($g_hListView, 1, "Row 2: Col 2", 1) _GUICtrlListView_AddItem($g_hListView, "Row 3: Col 1", 2) ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo ; Local $tBuffer $hWndListView = $g_hListView If Not IsHWnd($g_hListView) Then $hWndListView = GUICtrlGetHandle($g_hListView) $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode ; Case $LVN_BEGINDRAG ; A drag-and-drop operation involving the left mouse button is being initiated ; $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) ; _DebugPrint("$LVN_BEGINDRAG" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ ; "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ ; "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ ; "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ ; "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param")) ; ; No return value ; Case $LVN_BEGINLABELEDIT ; Start of label editing for an item ; $tInfo = DllStructCreate($tagNMLVDISPINFO, $lParam) ; _DebugPrint("$LVN_BEGINLABELEDIT" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->State:" & @TAB & DllStructGetData($tInfo, "State") & @CRLF & _ ; "-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @CRLF & _ ; "-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @CRLF & _ ; "-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @CRLF & _ ; "-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @CRLF & _ ; "-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @CRLF & _ ; "-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns")) ; Return False ; Allow the user to edit the label ; ;Return True ; Prevent the user from editing the label ; Case $LVN_BEGINRDRAG ; A drag-and-drop operation involving the right mouse button is being initiated ; $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) ; _DebugPrint("$LVN_BEGINRDRAG" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ ; "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ ; "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ ; "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ ; "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param")) ; ; No return value ; Case $LVN_BEGINSCROLL ; A scrolling operation starts, Minium OS WinXP ; $tInfo = DllStructCreate($tagNMLVSCROLL, $lParam) ; _DebugPrint("$LVN_BEGINSCROLL" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->DX:" & @TAB & DllStructGetData($tInfo, "DX") & @CRLF & _ ; "-->DY:" & @TAB & DllStructGetData($tInfo, "DY")) ; ; No return value Case $LVN_COLUMNCLICK ; A column was clicked $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) _DebugPrint("$LVN_COLUMNCLICK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF & _ "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ "-->Param:" & @TAB & DllStructGetData($tInfo, "Param")) ; No return value ; Case $LVN_DELETEALLITEMS ; All items in the control are about to be deleted ; $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) ; _DebugPrint("$LVN_DELETEALLITEMS" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ ; "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ ; "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ ; "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ ; "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param")) ; Return True ; To suppress subsequent $LVN_DELETEITEM messages ; ;Return False ; To receive subsequent $LVN_DELETEITEM messages ; Case $LVN_DELETEITEM ; An item is about to be deleted ; $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) ; _DebugPrint("$LVN_DELETEITEM" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ ; "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ ; "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ ; "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ ; "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param")) ; ; No return value ; Case $LVN_ENDLABELEDIT ; The end of label editing for an item ; $tInfo = DllStructCreate($tagNMLVDISPINFO, $lParam) ; $tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text")) ; _DebugPrint("$LVN_ENDLABELEDIT" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->State:" & @TAB & DllStructGetData($tInfo, "State") & @CRLF & _ ; "-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @CRLF & _ ; "-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @CRLF & _ ; "-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @CRLF & _ ; "-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @CRLF & _ ; "-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @CRLF & _ ; "-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @CRLF & _ ; "-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @CRLF & _ ; "-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns")) ; ; If Text is not empty, return True to set the item's label to the edited text, return false to reject it ; ; If Text is empty the return value is ignored ; Return True ; Case $LVN_ENDSCROLL ; A scrolling operation ends, Minium OS WinXP ; $tInfo = DllStructCreate($tagNMLVSCROLL, $lParam) ; _DebugPrint("$LVN_ENDSCROLL" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->DX:" & @TAB & DllStructGetData($tInfo, "DX") & @CRLF & _ ; "-->DY:" & @TAB & DllStructGetData($tInfo, "DY")) ; ; No return value ; Case $LVN_GETDISPINFO ; Provide information needed to display or sort a list-view item ; $tInfo = DllStructCreate($tagNMLVDISPINFO, $lParam) ; $tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text")) ; _DebugPrint("$LVN_GETDISPINFO" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->State:" & @TAB & DllStructGetData($tInfo, "State") & @CRLF & _ ; "-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @CRLF & _ ; "-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @CRLF & _ ; "-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @CRLF & _ ; "-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @CRLF & _ ; "-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @CRLF & _ ; "-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @CRLF & _ ; "-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @CRLF & _ ; "-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns")) ; ; No return value ; Case $LVN_GETINFOTIP ; Sent by a large icon view list-view control that has the $LVS_EX_INFOTIP extended style ; $tInfo = DllStructCreate($tagNMLVGETINFOTIP, $lParam) ; $tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text")) ; _DebugPrint("$LVN_GETINFOTIP" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Flags:" & @TAB & DllStructGetData($tInfo, "Flags") & @CRLF & _ ; "-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @CRLF & _ ; "-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam")) ; ; No return value ; Case $LVN_HOTTRACK ; Sent by a list-view control when the user moves the mouse over an item ; $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) ; _DebugPrint("$LVN_HOTTRACK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ ; "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ ; "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ ; "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ ; "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param")) ; Return 0 ; allow the list view to perform its normal track select processing. ; ;Return 1 ; the item will not be selected. ; Case $LVN_INSERTITEM ; A new item was inserted ; $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) ; _DebugPrint("$LVN_INSERTITEM" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ ; "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ ; "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ ; "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ ; "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param")) ; ; No return value ; Case $LVN_ITEMACTIVATE ; Sent by a list-view control when the user activates an item ; $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) ; _DebugPrint("$LVN_ITEMACTIVATE" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ ; "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ ; "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ ; "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ ; "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ ; "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _ ; "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags")) ; Return 0 ; Case $LVN_ITEMCHANGED ; An item has changed ; $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) ; _DebugPrint("$LVN_ITEMCHANGED" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ ; "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ ; "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ ; "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ ; "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param")) ; ; No return value ; Case $LVN_ITEMCHANGING ; An item is changing ; $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) ; _DebugPrint("$LVN_ITEMCHANGING" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ ; "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ ; "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ ; "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ ; "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param")) ; Return True ; prevent the change ; ;Return False ; allow the change Case $LVN_KEYDOWN ; A key has been pressed $tInfo = DllStructCreate($tagNMLVKEYDOWN, $lParam) _DebugPrint("$LVN_KEYDOWN" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF & _ "-->VKey:" & @TAB & DllStructGetData($tInfo, "VKey") & @CRLF & _ "-->Flags:" & @TAB & DllStructGetData($tInfo, "Flags")) ; No return value ; Case $LVN_MARQUEEBEGIN ; A bounding box (marquee) selection has begun ; _DebugPrint("$LVN_MARQUEEBEGIN" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode) ; Return 0 ; accept the message ; ;Return 1 ; quit the bounding box selection ; Case $LVN_SETDISPINFO ; Update the information it maintains for an item ; $tInfo = DllStructCreate($tagNMLVDISPINFO, $lParam) ; $tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text")) ; _DebugPrint("$LVN_SETDISPINFO" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode & @CRLF & _ ; "-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @CRLF & _ ; "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _ ; "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ ; "-->State:" & @TAB & DllStructGetData($tInfo, "State") & @CRLF & _ ; "-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @CRLF & _ ; "-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @CRLF & _ ; "-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @CRLF & _ ; "-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @CRLF & _ ; "-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @CRLF & _ ; "-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @CRLF & _ ; "-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @CRLF & _ ; "-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @CRLF & _ ; "-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns")) ; ; No return value Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) _DebugPrint("$NM_CLICK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF & _ "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _ "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _ "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags")) ; No return value Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) _DebugPrint("$NM_DBLCLK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF & _ "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _ "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _ "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags")) ; No return value ; Case $NM_HOVER ; Sent by a list-view control when the mouse hovers over an item ; _DebugPrint("$NM_HOVER" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ ; "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ ; "-->Code:" & @TAB & $iCode) ; Return 0 ; process the hover normally ; ;Return 1 ; prevent the hover from being processed Case $NM_KILLFOCUS ; The control has lost the input focus _DebugPrint("$NM_KILLFOCUS" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode) ; No return value Case $NM_RCLICK ; Sent by a list-view control when the user clicks an item with the right mouse button $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) _DebugPrint("$NM_RCLICK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF & _ "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _ "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _ "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags")) ;Return 1 ; not to allow the default processing Return 0 ; allow the default processing Case $NM_RDBLCLK ; Sent by a list-view control when the user double-clicks an item with the right mouse button $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) _DebugPrint("$NM_RDBLCLK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF & _ "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _ "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _ "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags")) ; No return value Case $NM_RETURN ; The control has the input focus and that the user has pressed the ENTER key _DebugPrint("$NM_RETURN" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode) ; No return value Case $NM_SETFOCUS ; The control has received the input focus _DebugPrint("$NM_SETFOCUS" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode) ; No return value EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func _DebugPrint($s_Text, $sLine = @ScriptLineNumber) ConsoleWrite( _ "!===========================================================" & @CRLF & _ "+======================================================" & @CRLF & _ "-->Line(" & StringFormat("%04d", $sLine) & "):" & @TAB & $s_Text & @CRLF & _ "+======================================================" & @CRLF) EndFunc ;==>_DebugPrint Read each case statements. They all are events of a list view. If you have doubts about them, read articles releted to them in MSDN site.1 point
-
This was only something within mind. That means I never tried anything in that direction yet. Currently I'm trying other things to speed up GDI+ stuff using ext. DLL which I create with FreeBasic. FreeBasic is very powerful and faaaaaaaaassssssssssttttttttt. Little example: Random Pixel Generator1 point
-
Convert letter to muber
Skysnake reacted to JLogan3o13 for a topic
Or, if you're looking for a 1-26 conversion, something like this perhaps: $abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" MsgBox(0, "", convert(9)) Func convert($n) return StringMid($abc, $n, 1) EndFunc1 point -
@kcvinu Try my ancient Process UDF (link my sig). It captures the console output of an application...1 point
-
What do you see in the SciTE outputpane when you hit F7? That should give you a pretty good hint what the commandline should be to compile in batch. Jos1 point
-
@kcvinu My pleasure Quotes in VB.Net are confusing . They need single quotes1 point
-
@kcvinu The path which you supplied to autoit3.exe is invalid and does not exists I see that you are doing AutoitCmd & Filename. Try doing this instead: AutoitCmd & ' "' & Filename & '"' I don't do VB.Net but its understandable so far P.S I recommend you to open another thread instead of using ISN AutoIt Studio's thread1 point
-
Was a fun couple of hours, was easier than I thought but attacked it from the wrong angle. And a big UDF is like a maze for me. The change to Case 3 makes Tab move the edit to the next row after the last column. Until the last row, where it just loops back to the first column. Can't believe such a simple thing took me so long, I need to get better at this. Time for bed. Case 0x09, 0x27 ; TAB or right arrow While 1 If $iEditCol <> 0 Then ; Set next column $aLocation[1] += 1 ; Check column exists If $aLocation[1] = _GUICtrlListView_GetColumnCount($hGLVEx_Editing) Then ; Does not exist so check required action Switch $iEditCol Case 1 ; Exit edit process ExitLoop 2 Case 2 ; Stay on same location $aLocation[1] -= 1 ExitLoop Case 3 ;; yay it works If $aLocation[0] + 1 < $aGLVEx_SrcArray[0][0] Then $aLocation[0] += 1 EndIf ; Loop $aLocation[1] = 0 EndSwitch EndIf1 point
-
pixelsearch on multiple monitor/extended display
EmilyLove reacted to JLogan3o13 for a topic
The only time other forum members should wait is if a Mod has been alerted to the potential legitimacy of a thread and has asked the OP to clarify. And while I agree that it can be frustrating when you know there is a better way, we have to remember that not everyone is at the same level of ability when it comes to scripting. Our intent on this forum is to help people learn to improve their scripts; not berate them. If you suggest a better way of doing something but the OP is dogmatic about doing it a specific way - as long as the thread is not against the forum rules - then no reason to keep beating a dead horse. If you have suggested a better alternative, but the OP wants to do it another way, either offer suggestions on how he can do so or leave the thread to others who will. The constant back and forth of "but you should be doing it this way", when the OP is obviously not going to heed the suggestion, serves no purpose but to frustrate everyone involved.1 point -
_WinTrust.au3
falcontechnics reacted to step887 for a topic
I did a bit of investigation, but I am not sure where to do from here On 32 bit: Code Line 306 Local $iSize = 1408 Code lines 321-324 DllStructGetData($CMSG_SIGNER_INFO, "Issuer_cbData") =183 DllStructGetData($CMSG_SIGNER_INFO, "Issuer_pbData"))= 0x02DFEFA8 DllStructGetData($CMSG_SIGNER_INFO, "SerialNumber_cbData") = 16 DllStructGetData($CMSG_SIGNER_INFO, "SerialNumber_pbData") = 0x06543FA8 On 64 bit: Local $iSize = 1568 DllStructGetData($CMSG_SIGNER_INFO, "Issuer_cbData") =0 DllStructGetData($CMSG_SIGNER_INFO, "Issuer_pbData"))= 00000000000000B7 DllStructGetData($CMSG_SIGNER_INFO, "SerialNumber_cbData") = 64509688 DllStructGetData($CMSG_SIGNER_INFO, "SerialNumber_pbData") = 0x0000000000000010 Edit So I figure it out.. it had to do with $tagCERT_INFO and $tagCMSG_SIGNER_INFO, if running under x64 it needed UINT64 instead of DWORD So I had to remove the const and replace DWORD with UINT64 if running under x64 Attached is the change _WinTrust (3).au31 point -
_WinTrust.au3
falcontechnics reacted to kasty for a topic
This new version allows retrieval of information about the certificate used to sign a file (serial number, owner and issuer). Tested in Windows 7 and Windows XP SP3. $filePath = ".\signed.exe" $signed = False If _WinVerifyTrust($filePath) = $ERROR_SUCCESS Then $signed = True ConsoleWrite($filepath & " is correctly signed = " & $signed & @LF) $certInfo = _GetSignatureInfo($filepath) ConsoleWrite("Serial Number: " & $certInfo[0] & @LF) ConsoleWrite("Owner: " & $certInfo[1] & @LF) ConsoleWrite("Issuer: " & $certInfo[2] & @LF)_WinTrust.au31 point