Leaderboard
Popular Content
Showing content with the highest reputation on 05/27/2021 in all areas
-
Copy all files of a folder without overwriting existing ones
Professor_Bernd and 2 others reacted to JockoDundee for a topic
So why not just have VBS call RoboCopy directly?3 points -
EasyCodeIt - cross-platform AutoIt implementation
TheDcoder and one other reacted to Earthshine for a topic
This project is NNNNN weeks LATE! our customers are going to be furious! LOL, nah, kidding, good job2 points -
Hello experts i need help to finish this project. I'am student and newbie
Earthshine and one other reacted to Jos for a topic
That is no excuse so goes into the BS bucket! Try again and this time show something with some substance that clearly shows what you have tried and isn't working. On top of that you have to clearly tell us what it is your are trying to get done as "this is for learning purpose only" is already dumped into that same BS bucket! So try again and this time be absolutely clear.2 points -
Hello experts i need help to finish this project. I'am student and newbie
Earthshine and one other reacted to Melba23 for a topic
lenorcam, But of course. M232 points -
Incremental search in owner and custom drawn ListViews
Gianni and one other reacted to pixelsearch for a topic
Hi, version "2q" below includes LarsJ column align. It is based on WM_DRAWITEM and it will be my last update for the moment. #include <ComboConstants.au3> #include <EditConstants.au3> #include <GuiListView.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include "RandomArray.au3" ; LarsJ #include "DrawItem.au3" ; " Opt("MustDeclareVars", 1) Global $g_iRows = 1000, $g_iCols = 6, $g_hGui, $g_hListView, $g_hHeader, $g_hEdit Global $g_aCols = ["Strings", "Integers", "Floats", "Dates", "Times", "R/C"], $g_aWidths = [230, 61, 124, 70, 60, 60] Global $g_aColAligns[$g_iCols] = [$HDF_CENTER, $HDF_RIGHT, $HDF_RIGHT, $HDF_RIGHT, $HDF_RIGHT, $HDF_RIGHT] ; $HDF_LEFT, $HDF_RIGHT, $HDF_CENTER Global $g_idListView, $g_idMarker, $g_idComboCol, $g_idComboColDummy, $g_idEditDummy Global $g_sSearch, $g_iSearchCol, $g_iSortDir, $g_iSearch = $g_iRows Global $g_aArray, $g_aSubArray, $g_tDefaultIndex, $g_tIndex = DllStructCreate("uint arr[" & $g_iRows & "]") Global $g_aIndex[$g_iCols], $g_aIndexTemp[$g_iCols] ; VarGetType's : $g_aIndex => "Array", $g_aIndex[0] => "String" Global $fListViewHasFocus = 1 ; trying this for now, we'll see... Example() Func Example() ; Generate array & one index _Generate_All($g_aArray) $g_aSubArray = $g_aArray $g_tDefaultIndex = $g_tIndex ; Create GUI $g_hGui = GUICreate("Virtual ListView + match 1 or All columns + Align (2q)", 630 + 20, 788 + 30 + 20) ; Create Edit control (search) + dummy control Local $idEdit = GUICtrlCreateEdit("", 120, 10, 305, 20, BitXOR($GUI_SS_DEFAULT_EDIT, $WS_HSCROLL, $WS_VSCROLL)) $g_hEdit = GUICtrlGetHandle($idEdit) $g_idEditDummy = GUICtrlCreateDummy() ; Create ComboBox control (how to search : RegEx or Normal ?) Local $idSearchHow = GUICtrlCreateCombo("RegEx search", 11, 9, 100, 20, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST)) Local $sSearchHow = "RegEx search", $sSearchHowPrev = $sSearchHow ; default way of searching (changeable) GUICtrlSetData($idSearchHow, "Normal search", $sSearchHow) ; Create ComboBox control (column where to search, possible All) + dummy control GUICtrlCreateLabel("Col", 429, 10, 20, 20, BitOR($SS_CENTERIMAGE, $SS_CENTER)) $g_idComboCol = GUICtrlCreateCombo("All", 452, 9, 41, 20, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST)) Local $sSearchCol = "All" ; default column where to search (changeable) => becomes $g_iSearchCol $g_iSearchCol = ($sSearchCol == "All" ? - 1 : Number($sSearchCol)) ; - 1 means search All columns Local $iSearchColPrev = $g_iSearchCol For $i = 0 To $g_iCols - 1 GUICtrlSetData($g_idComboCol, $i & "|", $g_iSearchCol) Next $g_idComboColDummy = GUICtrlCreateDummy() ; Create Label control (number of matching results) Local $idResult = GUICtrlCreateLabel(" " & $g_iRows & " rows (no pattern)", 501, 10, 135, 20, BitOR($SS_CENTERIMAGE, $SS_SUNKEN)) ; Create ListView $g_idListView = GUICtrlCreateListView("", 10, 40, 630, 788, BitOr($LVS_OWNERDATA, $LVS_OWNERDRAWFIXED), $WS_EX_CLIENTEDGE) _GUICtrlListView_SetExtendedListViewStyle($g_idListView, BitOr($LVS_EX_DOUBLEBUFFER, $LVS_EX_FULLROWSELECT)) $g_hListView = GUICtrlGetHandle($g_idListView) $g_hHeader = _GUICtrlListView_GetHeader($g_idListView) For $i = 0 To $g_iCols - 1 _GUICtrlListView_AddColumn($g_idListView, $g_aCols[$i], $g_aWidths[$i]) _GUICtrlHeader_SetItemFormat($g_hHeader, $i, $HDF_STRING + $g_aColAligns[$i]) Next ; No ListView column resizing by dragging header dividers (LarsJ) ;_WinAPI_SetWindowLong( $hHeader, $GWL_STYLE, _WinAPI_GetWindowLong( $hHeader, $GWL_STYLE ) + $HDS_NOSIZING ) ; AutoIt 3.3.14.5 issue DllCall( "user32.dll", "long_ptr", @AutoItX64 ? "SetWindowLongPtrW" : "SetWindowLongW", "hwnd", $g_hHeader, "int", $GWL_STYLE, "long_ptr", _ DllCall( "user32.dll", "long_ptr", @AutoItX64 ? "GetWindowLongPtrW" : "GetWindowLongW", "hwnd", $g_hHeader, "int", $GWL_STYLE )[0] + $HDS_NOSIZING ) ; Create Marker (an orange line placed above the header of the column being searched) $g_idMarker = GUICtrlCreateLabel("", 0, 0) GUICtrlSetBkColor(-1, 0xFFA060) ; orange _MoveMarker($g_iSearchCol) _GUICtrlListView_SetSelectedColumn($g_idListView, $g_iSearchCol) ; Sorting information $g_iSortDir = $HDF_SORTUP Local $iSortCol = -1, $iSortColPrev = -1 ; Register message handlers GUIRegisterMsg($WM_DRAWITEM, "WM_DRAWITEM") GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ; for LV header only GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") ; Sets the virtual number of items in a virtual list-view control GUICtrlSendMsg($g_idListView, $LVM_SETITEMCOUNT, $g_iRows, 0) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $g_idComboCol, $g_idComboColDummy, $idSearchHow $sSearchCol = GUICtrlRead($g_idComboCol) $g_iSearchCol = ($sSearchCol == "All" ? - 1 : Number($sSearchCol)) ; - 1 means search All columns $sSearchHow = GUICtrlRead($idSearchHow) Select Case $g_iSearchCol <> $iSearchColPrev _MoveMarker($g_iSearchCol) ; Search column will be selected below, after ContinueCase $iSearchColPrev = $g_iSearchCol Case $sSearchHow <> $sSearchHowPrev $sSearchHowPrev = $sSearchHow Case Else ; no change in both Combo controls (same search column, same search way) ContinueLoop EndSelect ContinueCase Case $g_idEditDummy _GUICtrlHeader_SetItemFormat($g_hHeader, $iSortCol, $HDF_STRING + ($iSortCol > -1 ? $g_aColAligns[$iSortCol] : 0)) $g_sSearch = GUICtrlRead($idEdit) $g_tIndex = $g_tDefaultIndex If $g_sSearch = "" Then ; Empty search string, display all rows $g_aSubArray = $g_aArray $g_iSearch = $g_iRows Else ; Find rows matching the search string $g_iSearch = 0 If $sSearchHow = "Normal search" Then ; all searches use RegEx => escape 12 + 1 metacharacters $g_sSearch = StringRegExpReplace($g_sSearch, "(\\|\.|\^|\$|\||\[|\(|\{|\*|\+|\?|\#|\))" , "\\$1") EndIf ; ConsoleWrite("$sSearchHow = " & $sSearchHow & @TAB & "$g_sSearch = " & $g_sSearch & @lf) If $g_iSearchCol = - 1 Then ; - 1 means search All columns For $i = 0 To $g_iRows - 1 For $j = 0 To $g_iCols - 1 If StringRegExp($g_aArray[$i][$j], "(?i)" & $g_sSearch) Then For $k = 0 To $g_iCols - 1 $g_aSubArray[$g_iSearch][$k] = $g_aArray[$i][$k] Next $g_iSearch += 1 ContinueLoop 2 EndIf Next Next Else ; Search only in 1 column For $i = 0 To $g_iRows - 1 If StringRegExp($g_aArray[$i][$g_iSearchCol], "(?i)" & $g_sSearch) Then For $j = 0 To $g_iCols - 1 $g_aSubArray[$g_iSearch][$j] = $g_aArray[$i][$j] Next $g_iSearch += 1 EndIf Next EndIf ; Delete eventual temporary subindexes For $i = 0 To $g_iCols - 1 If VarGetType($g_aIndexTemp[$i]) = "DLLStruct" Then $g_aIndexTemp[$i] = "" ; "String" Next EndIf GUICtrlSetData($idResult, " " & $g_iSearch & ($g_sSearch = "" ? " rows (no pattern)" : " matching rows")) GUICtrlSendMsg($g_idListView, $LVM_SETITEMCOUNT, $g_iSearch, 0) _GUICtrlListView_SetSelectedColumn($g_hListView, $g_iSearchCol) ; seems ok here (after $LVM_SETITEMCOUNT) Case $g_idListView ; Sort $iSortCol = GUICtrlGetState($g_idListView) If $iSortCol <> $iSortColPrev Then _GUICtrlHeader_SetItemFormat($g_hHeader, $iSortColPrev, $HDF_STRING + ($iSortColPrev > -1 ? $g_aColAligns[$iSortColPrev] : 0)) EndIf ; Set $g_tIndex + eventual update of $g_aIndexTemp[$iSortCol] OR $g_aIndex[$iSortCol] If GUICtrlRead($idEdit) Then _UpdateIndex($g_aIndexTemp, $iSortCol) Else _UpdateIndex($g_aIndex, $iSortCol) EndIf $g_iSortDir = (($iSortCol = $iSortColPrev) ? ($g_iSortDir = $HDF_SORTUP ? $HDF_SORTDOWN : $HDF_SORTUP) : ($HDF_SORTUP)) _GUICtrlHeader_SetItemFormat($g_hHeader, $iSortCol, $HDF_STRING + $g_aColAligns[$iSortCol] + $g_iSortDir) GUICtrlSendMsg($g_idListView, $LVM_SETSELECTEDCOLUMN, $iSortCol, 0) GUICtrlSendMsg($g_idListView, $LVM_SETITEMCOUNT, $g_iSearch, 0) $iSortColPrev = $iSortCol Case $GUI_EVENT_RESTORE ; needed, or Marker goes back in 0, 0 after Restore (why ?) _MoveMarker($g_iSearchCol) EndSwitch WEnd ; Cleanup GUIDelete($g_hGui) EndFunc ;==>Example ;======================================================================== Func WM_DRAWITEM( $hWnd, $iMsg, $wParam, $lParam ) ; Display items in an owner drawn ListView Local Static $tRect = DllStructCreate( $tagRECT ), $pRect = DllStructGetPtr( $tRect ), $tSize = DllStructCreate( $tagSIZE ) Local Static $hBrushYellow = _WinAPI_CreateSolidBrush( 0xFFFF00 ), $hBrushCyan = _WinAPI_CreateSolidBrush( 0x00FFFF ) ; Yellow and cyan, BGR Local Static $hBrushHighLight = _WinAPI_GetSysColorBrush( $COLOR_HIGHLIGHT ), $hBrushButtonFace = _WinAPI_GetSysColorBrush( $COLOR_BTNFACE ) ; We can optimize code by removing Switch statements because the ListView is the only ownerdrawn control and only $ODA_DRAWENTIRE actions are present Local $tDrawItem = DllStructCreate( $tagDRAWITEM, $lParam ), $itemID = DllStructGetData( $tDrawItem, "itemID" ), $iState = DllStructGetData( $tDrawItem, "itemState" ), $hDC = DllStructGetData( $tDrawItem, "hDC" ), $sItemText ; Loop through columns ($i is the column index) For $i = 0 To $g_iCols - 1 ; Subitem rectangle DllStructSetData( $tRect, 2, $i ) ; Top DllStructSetData( $tRect, 1, $LVIR_BOUNDS ) ; Left GUICtrlSendMsg( $g_idListView, $LVM_GETSUBITEMRECT, $itemID, $pRect ) DllStructSetData( $tRect, 1, DllStructGetData( $tRect, 1 ) + 3 ) ; Left margin ; If $i = 0 (first column), the rectangle is calculated for the entire listview item. ; Compensate for this by setting the width of the rectangle to the width of the first column. ; Before that, if item is selected, fill the entire listview item with the highlight background color. If $i = 0 Then If BitAND( $iState, $ODS_SELECTED ) Then DllCall( "user32.dll", "int", "FillRect", "handle", $hDC, "struct*", $tRect, "handle", $fListViewHasFocus = 1 ? $hBrushHighLight : $hBrushButtonFace ) ; _WinAPI_FillRect DllStructSetData( $tRect, 3, DllStructGetData( $tRect, 1 ) + GUICtrlSendMsg( $g_idListView, $LVM_GETCOLUMNWIDTH, 0, 0 ) ) EndIf ; Retrieve subitem text If $g_iSortDir = 0x0400 Then ; 0x0400 = $HDF_SORTUP $sItemText = $g_aSubArray[$g_tIndex.arr($itemID + 1)][$i] Else $sItemText = $g_aSubArray[$g_tIndex.arr($g_iSearch - $itemID)][$i] EndIf ; Subitem rectangle for right and center aligned columns If $g_aColAligns[$i] = $HDF_RIGHT Or $g_aColAligns[$i] = $HDF_CENTER Then DllCall( "gdi32.dll", "bool", "GetTextExtentPoint32W", "handle", $hDC, "wstr", $sItemText, "int", StringLen( $sItemText ), "struct*", $tSize ) ; _WinAPI_GetTextExtentPoint32 Switch $g_aColAligns[$i] Case $HDF_RIGHT DllStructSetData( $tRect, "Left", DllStructGetData( $tRect, "Right" ) - DllStructGetData( $tSize, "X" ) - 6 ) Case $HDF_CENTER DllStructSetData( $tRect, "Left", DllStructGetData( $tRect, "Left" ) + ( DllStructGetData( $tRect, "Right" ) - DllStructGetData( $tRect, "Left" ) - DllStructGetData( $tSize, "X" ) ) / 2 - 3 ) EndSwitch EndIf ; Subitem text color DllCall( "gdi32.dll", "int", "SetTextColor", "handle", $hDC, "int", BitAND( $iState, $ODS_SELECTED ) ? $fListViewHasFocus = 1 ? 0xFFFFFF : 0x000000 : 0x000000 ) ; _WinAPI_SetTextColor ; Draw subitem text DllCall( "user32.dll", "int", "DrawTextW", "handle", $hDC, "wstr", $sItemText, "int", StringLen( $sItemText ), "struct*", $tRect, "uint", 0 ) ; _WinAPI_DrawText ; Skip column if search for 1 column only and $i is not the searched column If $g_iSearchCol > - 1 And $i <> $g_iSearchCol Then ContinueLoop ; > - 1 means search for 1 column (0, 1, 2...) ; Mark matching substring if found in this column If $g_sSearch Then Local $sMatch = StringRegExp( $sItemText, "(?i)" & $g_sSearch, 1 ) If Not @error Then ; match found Local $extended = @extended, $iLen = StringLen( $sMatch[0] ) ; Rectangle for matching substring DllCall( "gdi32.dll", "bool", "GetTextExtentPoint32W", "handle", $hDC, "wstr", $sItemText, "int", $extended - $iLen - 1, "struct*", $tSize ) ; _WinAPI_GetTextExtentPoint32 DllStructSetData( $tRect, "Left", DllStructGetData( $tRect, "Left" ) + DllStructGetData( $tSize, "X" ) ) DllCall( "gdi32.dll", "bool", "GetTextExtentPoint32W", "handle", $hDC, "wstr", $sMatch[0], "int", $iLen, "struct*", $tSize ) ; _WinAPI_GetTextExtentPoint32 DllStructSetData( $tRect, "Right", DllStructGetData( $tRect, "Left" ) + DllStructGetData( $tSize, "X" ) ) ; Fill rectangle with yellow or cyan (selected) background color DllStructSetData( $tRect, 2, DllStructGetData( $tRect, 2 ) + 1 ) ; Top margin DllCall( "user32.dll", "int", "FillRect", "handle", $hDC, "struct*", $tRect, "handle", BitAND( $iState, $ODS_SELECTED ) ? $hBrushCyan : $hBrushYellow ) ; _WinAPI_FillRect ; Draw matching substring in rectangle DllStructSetData( $tRect, 2, DllStructGetData( $tRect, 2 ) - 1 ) ; Top margin DllCall( "gdi32.dll", "int", "SetTextColor", "handle", $hDC, "int", 0x000000 ) ; _WinAPI_SetTextColor DllCall( "user32.dll", "int", "DrawTextW", "handle", $hDC, "wstr", $sMatch[0], "int", $iLen, "struct*", $tRect, "uint", 0 ) ; _WinAPI_DrawText EndIf EndIf Next Return $GUI_RUNDEFMSG #forceref $hWnd, $iMsg, $wParam EndFunc ;======================================================================== Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) Local $tNMHEADER = DllStructCreate($tagNMHEADER, $lParam) Switch HWnd(DllStructGetData($tNMHEADER, "hWndFrom")) Case $g_hHeader Local $iCode = DllStructGetData($tNMHEADER, "Code") Switch $iCode Case $NM_RCLICK Local $aHit = _GUICtrlListView_SubItemHitTest($g_hListView) ; $aHit[1] : 0-based index of the LV subitem... i.e. the column in our case (may be -1 if right click on empty part of header) If $aHit[1] > - 1 Then ; valid column GUICtrlSetData($g_idComboCol, $aHit[1]) GUICtrlSendToDummy($g_idComboColDummy) EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY ;======================================================================== Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $hWndFrom = $lParam Local $iCode = BitShift($wParam, 16) ; High word Switch $hWndFrom Case $g_hEdit Switch $iCode Case $EN_CHANGE GUICtrlSendToDummy($g_idEditDummy) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND ;======================================================================== Func _Generate_All(ByRef $g_aArray) ConsoleWrite("$g_iRows = " & $g_iRows & " $g_iCols = " & $g_iCols & @CRLF) Local $hTimer = TimerInit() $g_aArray = FAS_Random2DArrayAu3($g_iRows, "sifdtr", "abcdefghijklmnopqrstuvwxyz") ; $g_aArray = FAS_Random2DArrayAu3($g_iRows, "sifdtr", "abcdefghijklmnopqrstuvwxyz" & "\.^$|[({*+?#)") ; 12 + 1 RegEx metacharacters For $i = 0 To $g_iRows - 1 $g_tIndex.arr($i + 1) = $i Next ConsoleWrite("Generating array & one index = " & TimerDiff($hTimer) & @CRLF & @CRLF) EndFunc ;==>_Generate_All ;======================================================================== Func _SortArrayStruct(Const ByRef $aArray, $iCol, $iRows) Local $tIndex = DllStructCreate("uint arr[" & $iRows & "]") Local $pIndex = DllStructGetPtr($tIndex) Local Static $hDll = DllOpen("kernel32.dll") Local Static $hDllComp = DllOpen("shlwapi.dll") Local $lo, $hi, $mi, $r ; Sorting by one column For $i = 1 To $iRows - 1 $lo = 0 $hi = $i - 1 Do $mi = Int(($lo + $hi) / 2) $r = DllCall($hDllComp, 'int', 'StrCmpLogicalW', 'wstr', $aArray[$i][$iCol], 'wstr', $aArray[DllStructGetData($tIndex, 1, $mi + 1)][$iCol])[0] Switch $r Case -1 $hi = $mi - 1 Case 1 $lo = $mi + 1 Case 0 ExitLoop EndSwitch Until $lo > $hi DllCall($hDll, "none", "RtlMoveMemory", "struct*", $pIndex + ($mi + 1) * 4, "struct*", $pIndex + $mi * 4, "ulong_ptr", ($i - $mi) * 4) DllStructSetData($tIndex, 1, $i, $mi + 1 + ($lo = $mi + 1)) Next Return $tIndex EndFunc ;==>_SortArrayStruct ;======================================================================== Func _UpdateIndex(ByRef $aIndex, $iCol) If VarGetType($aIndex[$iCol]) = "DLLStruct" Then $g_tIndex = $aIndex[$iCol] Else $g_tIndex = _SortArrayStruct($g_aSubArray, $iCol, $g_iSearch) $aIndex[$iCol] = $g_tIndex ; "DLLStruct" (or "Int32" when no match found +++) EndIf EndFunc ;==>_UpdateIndex ;======================================================================== Func _MoveMarker($iCol) If $iCol = - 1 Then ; All columns ControlMove($g_hGui, "", $g_idMarker, 10, 40 - 3, 630, 3) ; 10 / 40 / 630 are LV coords Else ; 1 column (0, 1, 2...) Local $aRect = _GUICtrlHeader_GetItemRect($g_hHeader, $iCol) ControlMove($g_hGui, "", $g_idMarker, 10 + $aRect[0], 40 - 3, $aRect[2] - $aRect[0] + 1, 3) EndIf EndFunc ;==>_MoveMarker You should be able to combine the present functionalities with $NM_CUSTOMDRAW instead of $WM_DRAWITEM, not forgetting the special context menu found in this thread, and not forgetting Norm73's wish to immediately scroll on 1st match, for example like in the pic below (2 first non-matching lines left visible on purpose) . The pic below is not a script, it's just the way it could appear : @Norm73 unfortunately _GUICtrlListView_EnsureVisible (as indicated in one of your last post) isn't enough to do what you want. It sometimes display the requested item at the bottom of the screen (if you were selecting an item placed below it) LVM_GETTOPINDEX is useful to retrieve the index of the topmost visible item, but unfortunately there is no "LVM_SETTOPINDEX" to force an item to be placed at topmost position. After some searches here & there, I tested a way that can do it and it seems to work fine. Here is the code in case anyone is interested : ;~ ; It works !!! ;~ Local $iRow1stMatch = 200 ;~ Local $iGetTopIndex = _GUICtrlListView_GetTopIndex($g_idListView) ;~ Local $iGetItemSpacingY = _GUICtrlListView_GetItemSpacingY($g_idListView, True) ; only once ;~ _GUICtrlListView_Scroll($g_idListView, 0, ($iRow1stMatch - $iGetTopIndex) * $iGetItemSpacingY) Now it's time to rest, no more AutoIt during several days. Good luck guys and see you one of these days2 points -
Grab chaning xpath by last 3 characters in chrome (WebDriver)
seadoggie01 and one other reacted to TheXman for a topic
Have you tried using the xpath ends-with() function? Here's a nice xpath cheat sheet with examples: https://devhints.io/xpath2 points -
Copy all files of a folder without overwriting existing ones
Earthshine reacted to Professor_Bernd for a topic
Yes, if that's the case, ... then you got an upvote from me now, too. I was worried about Windows 7, but I just tested it successfully. So for Robocopy, there was no flashing of the CMD window on Win 7 and Win 10. I will now have VBScript call Robocopy directly, without AutoIt. I don't know if you can say that in English, "Sometimes you can't see the forest for the trees!" Thanks for opening my eyes!1 point -
Copy all files of a folder without overwriting existing ones
seadoggie01 reacted to JockoDundee for a topic
Nah, just the upvote1 point -
Can javascript change the variable value via the byref like au3?
Earthshine reacted to JLogan3o13 for a topic
Much like asking a Toyota group about why your Ford won't start. Just because they are both car groups doesn't mean you're asking the question in the right place.1 point -
#Include <WindowsConstants.au3> #Include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 640, 480, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX)) $Button1 = GUICtrlCreateButton("Maximize", 80, 56, 113, 33) GUISetState() GUIRegisterMsg($WM_SIZE, "WM_SIZE") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 WinSetState($hGUI, "", @SW_MAXIMIZE) Sleep(1000) WinSetState($hGUI, "", @SW_RESTORE) EndSwitch WEnd ; https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-size Func WM_SIZE($hWnd, $Msg, $wParam, $lParam) Switch BitAND($wParam, 0xFFFF) Case 0 ; SIZE_RESTORED ConsoleWrite("Window was restored" & @LF) Case 1 ; SIZE_MINIMIZED ConsoleWrite("Window was minimized" & @LF) Case 2 ; SIZE_MAXIMIZED ConsoleWrite("Window was maximized" & @LF) Case 3 ; SIZE_MAXSHOW ConsoleWrite("SIZE_MAXSHOW" & @LF) Case 4 ; SIZE_MAXHIDE ConsoleWrite("SIZE_MAXHIDE" & @LF) EndSwitch Return "GUI_RUNDEFMSG" EndFunc1 point
-
Why would the new thread know anything about the GUI controls? Doubt it does as it is a separate process, so you would have to use Controlxxx() functions like you would when automating a different program. \ Jos1 point
-
Hello experts i need help to finish this project. I'am student and newbie
Earthshine reacted to lenorcam for a topic
Yes something like that1 point -
Hello experts i need help to finish this project. I'am student and newbie
Earthshine reacted to JockoDundee for a topic
Is this for a typing class?1 point -
Hello experts i need help to finish this project. I'am student and newbie
Earthshine reacted to Jos for a topic
Did you open the helpfile and check out ALL the examples of the different loop option like For...Next, While...Wend etc? Jos1 point -
Copy all files of a folder without overwriting existing ones
Earthshine reacted to ViciousXUSMC for a topic
I was just jumping in to say, while I love to use AutoIT, when it aint broke don't fix it. Robocopy is perfect for this, as a server/backup admin I used it ALOT and you can easily implement it into a schedule task or other things.1 point -
help connecting to my tcp server via public ip
Earthshine reacted to Jos for a topic
You asking this question is the biggest risk as you clearly don't yet know what you are getting into!1 point -
Can javascript change the variable value via the byref like au3?
Letraindusoir reacted to bogQ for a topic
You can change global variable data or object and set new data or even better make a return if that is available. Note that your question is on wrong place, this is autoit help and support part of forum, not a javascript support . https://stackoverflow.com/a/7744623/1775164 Note that your calling innerHTML = arh; probably before data is fetched, so delite that line and put document.getElementById("demo").innerHTML = header; right after header=xhttp.getAllResponseHeaders(); or use https://javascript.info/async-await1 point -
Copy all files of a folder without overwriting existing ones
Subz reacted to Earthshine for a topic
@Professor_Bernd Use this code: #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> $result = 0 Example() Func Example() Local $sFilePath ; Creates the source folder. ; Should copy all files from the source folder to the destination folder without overwriting existing files. ;~ FileCopy("d:\xSlog\*.*", "d:\MyDestDir\*.*", $FC_NOOVERWRITE + $FC_CREATEPATH) Run("robocopy d:\xSlog d:\MyDestDir\ /r:0 /z", @ScriptDir) ; Display the temporary directory. EndFunc ;==>Example That does what you want exactly. If you ALSO want to pick up subdirectories and their files, do this: #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> $result = 0 Example() Func Example() Local $sFilePath ; Creates the source folder. ; Should copy all files from the source folder to the destination folder without overwriting existing files. ;~ FileCopy("d:\xSlog\*.*", "d:\MyDestDir\*.*", $FC_NOOVERWRITE + $FC_CREATEPATH) Run("robocopy d:\xSlog d:\MyDestDir\ /s /e /r:0 /z", @ScriptDir) ; Display the temporary directory. EndFunc ;==>Example Just make sure to substitute YOUR input and output directories in the code. I used mine as a test because it had lots of files and subfolders.1 point -
I just ran this and got 5 message boxes as I suspected. If you're having problems Mikeman27294 please post a re-producing script of the problem. AU3_Example.txt file: MsgBox(0, "It Works", "Hello World") AutoIt Script: _RunAU3("AU3_Example.txt") _RunAU3("AU3_Example.txt") _RunAU3("AU3_Example.txt") _RunAU3("AU3_Example.txt") _RunAU3("AU3_Example.txt") Func _RunAU3($sFilePath, $sWorkingDir = "", $iShowFlag = @SW_SHOW, $iOptFlag = 0) Return Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $sFilePath & '"', $sWorkingDir, $iShowFlag, $iOptFlag) EndFunc ;==>_RunAU3 SmartAlec, This is an example of how to do it, though I still expect you to do a bit of research on the subject.1 point
-
WebDriver UDF - Help & Support (III)
Danp2 reacted to seadoggie01 for a topic
While I don't receive an error about those capabilities, it doesn't stop the tab from being discarded0 points