Leaderboard
Popular Content
Showing content with the highest reputation on 06/14/2020 in Posts
-
Help with removing X line in text
FrancescoDiMuro and one other reacted to jchd for a topic
Fair point mi\Kell2 points -
Why can't I open the autohotkey-specific scite editor?
argumentum and one other reacted to JeffAllenNJ for a topic
Thanks so much. I read that post before but didn't notice the answer was kind of buried. The solution involved shutting down SciTE and then executing the AHK-specific version of SciTE, open "options=>user properties" and add the line "check.if.already.open=0". Save the file and ... voila ... AHK files now open with the AHK-specific version of SciTE and au3 opens with the AutoIt version. In actuality, I think none of this has anything to do with AutoIt or AHK but, rather SciTE itself. Alas, there does not seem to be an SciTE forum. Further, I think there might be a better solution by merging the files (global.properties, ahk.api, etc...) from both installation directories. Unfortunately, I don't know how exactly but I think it's just a matter of teaching whatever version of SciTE you choose to run how to handle different languages ... kind of like Eclipse. For now, I think I'll just stick to the "check.if.already.open=0" solution.2 points -
1 point
-
Get title window from RDP
TheXman reacted to argumentum for a topic
yes, obviously. You are getting the info from your PC. If you copy your script to the remote PC ( via \\tsclient\c\ maybe ), you can run it from the remote PC, within the remote PC environment1 point -
27 November 2019: Uploaded a new SciTE4AutoIt3.exe v19.1127.1402.0 installer.
argumentum reacted to Jos for a topic
I never use that directive myself either .... but it should be fixed again in the current Beta. Jos1 point -
27 November 2019: Uploaded a new SciTE4AutoIt3.exe v19.1127.1402.0 installer.
argumentum reacted to Jos for a topic
You mean that the directive is updated when you change it in the GUI (Ctrl+F7) but it still compiles with its previous setting? It only works when you run it the second time right now. Jos1 point -
Foto? This means Picture in Dutch, but I am sure that is not what you meant.1 point
-
27 November 2019: Uploaded a new SciTE4AutoIt3.exe v19.1127.1402.0 installer.
argumentum reacted to Jos for a topic
Of course not ... it was added for the shear fact I stopped compiling, thus using "#AutoIt3Wrapper_Res_Fileversion=" had no purpose anymore! So yes, I guess you can see it as an Feature as well in that respect. EDIT: I did restore a couple of directives as these are (of course) needed for the versioning and versionnumber.1 point -
Maybe something like this?: Local $sLCleanBody=StringRegExpReplace($sGBodyHtml ,'(?m)(?s)<div.*?PurchaseHistoryOrdersContaine','') Jos1 point
-
Hi, i decided to take on a personal challenge: To enable drag and drop of items and subitems, and to allow editing of any item in the default listview with a double click. #include <GUIConstantsEx.au3> #include <GuiImageList.au3> #include <GuiListView.au3> #include <GuiStatusBar.au3> #include <WindowsConstants.au3> #include <Misc.au3> ;============================================================================= OnAutoItExitRegister("Quit") Opt("TrayMenuMode", 1) Opt("TrayIconHide", 0) Opt("GUICoordMode", 0) Opt("GUIResizeMode", 1) Opt("TrayIconDebug", 1) Opt("TrayAutoPause", 0) Opt("MouseCoordMode", 2) Opt("GUIOnEventMode", 1) Opt("MustDeclareVars", 1) Opt("GUIEventOptions", 1) Opt("TrayOnEventMode", 1) Opt("ExpandEnvStrings", 1) Opt("WinTitleMatchMode", 3) Opt("WinDetectHiddenText", 1) ;============================================================================= GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") Global $g_idListView, $g_hStatusBar, $g_iIndex = -1, $g_iSubIndex = -1 Global $hImage, $hGUI, $LVGui, $lvedit, $aHit, $WPos, $subrect, $Window, $WE = 0 Global $CursorInfo, $Drag0Based, $DragSub, $Drop0Based, $DropSub, $idMsg, $GetDragTxt, $GetDropTxt Global $hDLL = DllOpen("user32.dll") ;============================================================================= ; Create GUI $hGUI = GUICreate("ListView SubItem Hit Test", 400, 300) $g_idListView = GUICtrlCreateListView("", 2, 2, 394, 268, $LVS_SINGLESEL, $LVS_EX_GRIDLINES+$LVS_EX_SUBITEMIMAGES+$LVS_EX_FULLROWSELECT) $g_idListView = GUICtrlGetHandle($g_idListView) ; get the handle for use in the notify events GUISetState(@SW_SHOW) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "Drag", $hGUI) GUISetOnEvent($GUI_EVENT_PRIMARYUP, "Drop", $hGUI) ;============================================================================= ; Load images $hImage = _GUIImageList_Create() _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($g_idListView, 0xFF0000, 16, 16)) _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($g_idListView, 0x00FF00, 16, 16)) _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($g_idListView, 0x0000FF, 16, 16)) _GUICtrlListView_SetImageList($g_idListView, $hImage, 1) ; Add columns _GUICtrlListView_AddColumn($g_idListView, "Column 1", 100) _GUICtrlListView_AddColumn($g_idListView, "Column 2", 100) _GUICtrlListView_AddColumn($g_idListView, "Column 3", 100) ; Add items _GUICtrlListView_AddItem($g_idListView, "Row 1: Col 1", 0) _GUICtrlListView_AddSubItem($g_idListView, 0, "Row 1: Col 2", 1, 1) _GUICtrlListView_AddSubItem($g_idListView, 0, "Row 1: Col 3", 2, 2) _GUICtrlListView_AddItem($g_idListView, "Row 2: Col 1", 1) _GUICtrlListView_AddSubItem($g_idListView, 1, "Row 2: Col 2", 1, 2) _GUICtrlListView_AddItem($g_idListView, "Row 3: Col 1", 2) For $i = 4 To 30 _GUICtrlListView_AddItem($g_idListView, "Row "&$i&": Col 1", Random(0, 2, 1)) Next ;============================================================================= While 1 If WinActive($LVGui) Then If _IsPressed('0D', $hDLL) Then _GUICtrlListView_SetItemText($g_idListView, $aHit[0], GUICtrlRead($lvedit), $aHit[1]) GUICtrlDelete($lvedit) GUIDelete($LVGui) EndIf Else If WinExists($LVGui) Then GUICtrlDelete($lvedit) GUIDelete($LVGui) EndIf EndIf Sleep(100) WEnd ;============================================================================= Func Drag() $aHit = _GUICtrlListView_SubItemHitTest($g_idListView) If $aHit[0] <> -1 Then $Drag0Based = $aHit[0] $DragSub = $aHit[1] ConsoleWrite('# '&$Drag0Based&' - '& $DragSub&@CRLF) Else $Drag0Based = -1 $DragSub = -1 EndIf EndFunc ;==>ListView_Click ;============================================================================= Func Drop() $aHit = _GUICtrlListView_SubItemHitTest($g_idListView) If $aHit[0] <> -1 Then $Drop0Based = $aHit[0] $DropSub = $aHit[1] ConsoleWrite('# '&$Drop0Based&' - '& $DropSub&@CRLF) If $Drag0Based <> -1 And $DragSub <> -1 Then ;============================================================================= $GetDragTxt = _GUICtrlListView_GetItemText($g_idListView, $Drag0Based, $DragSub) $GetDropTxt = _GUICtrlListView_GetItemText($g_idListView, $Drop0Based, $DropSub) _GUICtrlListView_SetItemText($g_idListView, $Drop0Based, $GetDragTxt, $DropSub) _GUICtrlListView_SetItemText($g_idListView, $Drag0Based, $GetDropTxt, $DragSub) EndIf EndIf EndFunc ;==>ListView_Click ;============================================================================= Func ListView_Click() $aHit = _GUICtrlListView_SubItemHitTest($g_idListView) If $aHit[0] <> -1 Then $WPos = WinGetPos($hGUI) $subrect = _GUICtrlListView_GetSubItemRect($g_idListView, $aHit[0], $aHit[1], 0) $LVGui = GUICreate('input', 100, 20, $subrect[0] + $WPos[0], $subrect[1] + $WPos[1] + 30, $WS_POPUP, $WS_EX_TOPMOST) $lvedit = GUICtrlCreateInput(_GUICtrlListView_GetItemText($g_idListView, $aHit[0], $aHit[1]), 0, 0, $subrect[2] - $subrect[0], $subrect[3] - $subrect[1]) GUISetState(@SW_SHOW, $LVGui) EndIf EndFunc ;==>ListView_Click ;============================================================================= Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo $hWndListView = $g_idListView If Not IsHWnd($g_idListView) Then $hWndListView = GUICtrlGetHandle($g_idListView) $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode 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) ListView_Click() EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY ;============================================================================= Func Quit() Exit EndFunc ;==>Quit ;============================================================================= So, the functions are: Double click any item to edit it's text, enter to confirm. Drag any cell and drop in any other to replace it.1 point
-
1 point
-
[BUGFIX VERSION] - 14 Jun 20 Fixed: A bug in the Load function and one I introduced in the fix for an earlier bug (mea culpa!). New zip containing new UDF and several example scripts in first post. M231 point
-
@Dan_555 Nice function, reminds me of a similar function (strseg) that I wrote, but in C It basically does the same thing, search for the next delimiter and return the string. It doesn't have support for the different directions though!1 point
-
Hi, here is a small function, which i wrote to avoid the StringSplit and its array usage. It searches (directional search - from Left or Right) a String for the delimiter, and returns the remainder of the String with direction (left side/right side) including or excluding the delimiter char. The delimiter is limited to 1 char. ;Example is at the bottom ! Func _StringSearchSplit($str, $delimiter, $dir = "L", $ret = "R", $incdel = -1) ; #FUNCTION# ==================================================================================================================== ; Name ..........: _StringSearchSplit ; Description ...: Search for the first delimiter in a string, with searching direction, Case Sensitive search ; Syntax ........: _StringSearchSplit( $String, $delimiter [, $dir ] [, $ret ] [, $incdel ]) ; Parameters ....: $String - String to be checked. ; $delimiter - 1 char delimiter, has to be defined ; $dir - Search from direction (Left/Right), use "L" or "R" - Left is default ; The first letter will be used for direction, if multiple letters are entered e.g "Lab" = "L" ; $ret - Return side, Left or Right - Right is default. see above for valid entries. ; $incdel - Include delimiter 0 = No, 1 = Yes ; ; Return values .: Success - String ; ; e.g. 1: _StringSearch("c:\bat\test.bb","\","L","L") returns "c:" ; e.g. 2: _StringSearch("c:\bat\test.bb","\","L","L",1) returns "c:\" ; e.g. 3: _StringSearch("c:\bat\test.bb","\","L","R") returns "bat\test.bb" ; e.g. 4: _StringSearch("c:\bat\test.bb","\","L","R",1) returns "\bat\test.bb" ; e.g. 5: _StringSearch("c:\bat\test.bb","\","R","R") returns "test.bb" ; e.g. 6: _StringSearch("c:\bat\test.bb","\","R","R",1) returns "\test.bb" ; ; Failure - Empty string and @error flag as follows: ; @error : 1 - Empty String ; 2 - Delimiter should have a length of 1 char ; 3 - Should not happen, but if it does, search the PANIC button ! ; Author ........: Dan_555 (Autoitscript.com forum) ; =============================================================================================================================== Local $y Local $tmptxt = "" $dir = StringLeft(StringUpper($dir),1) $ret = StringLeft(StringUpper($ret),1) SetError(0) If StringLen($str) = 0 Then SetError(1) ;empty string Return "" EndIf If (StringInStr($str, $delimiter) = 0) Or (StringLen($delimiter) <> 1) Then SetError(2) ;invalid delimiter Return "" EndIf If $dir <> "L" And $dir <> "R" Then $dir = "L" ;Set default values If $ret <> "L" And $ret <> "R" Then $ret = "R" If $dir = "L" Then $y = StringInStr($str, $delimiter, 1) ;Search for the delimiter If $dir = "R" Then $y = StringInStr($str, $delimiter, 1, -1) If $incdel = 0 Then $incdel = -1 ;Tricky calculations ;) If $incdel <> -1 Then $incdel = 0 If $ret = "L" Then Return StringMid($str, 1, $y + $incdel) ;DisAssemble the string If $ret = "R" Then Return StringMid($str, $y - $incdel) SetError (3) Return "" EndFunc ;==>_StringSearchSplit ;~ ;Example ;~ $tmptxt = "c:\bAt\man\mobile.cAll" ;~ $s1 = "a" ;~ $s2 = "\" ;~ $s3="-----------------------------------" ;~ CW("Search string: " & $tmptxt) ;~ CW($s3 & "<") ;~ CW("LL" & $s1 & "0 " & _StringSearchSplit($tmptxt, $s1, "L", "L")) ;~ CW("LL" & $s1 & "1 " & _StringSearchSplit($tmptxt, $s1, "L", "L", 1)) ;~ CW($s3 & "<") ;~ CW("LR" & $s1 & "0 " & _StringSearchSplit($tmptxt, $s1, "L", "R")) ;~ CW("LR" & $s1 & "1 " & _StringSearchSplit($tmptxt, $s1, "L", "R", 1)) ;~ CW($s3 & "<") ;~ CW("RR" & $s1 & "0 " & _StringSearchSplit($tmptxt, $s1, "R", "R")) ;~ CW("RR" & $s1 & "1 " & _StringSearchSplit($tmptxt, $s1, "R", "R", 1)) ;~ CW($s3 & "<") ;~ CW("RL" & $s1 & "0 " & _StringSearchSplit($tmptxt, $s1, "R", "L")) ;~ CW("RL" & $s1 & "1 " & _StringSearchSplit($tmptxt, $s1, "R", "L", 1)) ;~ CW($s3 & "<" & " Second Example :") ;~ CW("LL" & $s2 & "0 " & _StringSearchSplit($tmptxt, $s2, "L", "L")) ;~ CW("LL" & $s2 & "1 " & _StringSearchSplit($tmptxt, $s2, "L", "L", 1)) ;~ CW($s3 & "<") ;~ CW("LR" & $s2 & "0 " & _StringSearchSplit($tmptxt, $s2, "L", "R")) ;~ CW("LR" & $s2 & "1 " & _StringSearchSplit($tmptxt, $s2, "L", "R", 1)) ;~ CW($s3 & "<") ;~ CW("RR" & $s2 & "0 " & _StringSearchSplit($tmptxt, $s2, "R", "R")) ;~ CW("RR" & $s2 & "1 " & _StringSearchSplit($tmptxt, $s2, "R", "R", 1)) ;~ CW($s3 & "<") ;~ CW("RL" & $s2 & "0 " & _StringSearchSplit($tmptxt, $s2, "R", "L")) ;~ CW("RL" & $s2 & "1 " & _StringSearchSplit($tmptxt, $s2, "R", "L", 1)) ;~ Func CW($txt) ;~ ConsoleWrite(" > " & $txt & @CRLF) ;~ EndFunc ;==>CW ;~ ;- End of the example1 point
-
This if GUICtrlRead($eintragen_Angelmethode_input) = "Grundfischen" Or "Posenfischen" Then must be if GUICtrlRead($eintragen_Angelmethode_input) = "Grundfischen" Or GUICtrlRead($eintragen_Angelmethode_input) = "Posenfischen" Then or $sAngelmethode = GUICtrlRead($eintragen_Angelmethode_input) If $sAngelmethode = "Grundfischen" Or $sAngelmethode = "Posenfischen" Then1 point
-
Why can't I open the autohotkey-specific scite editor?
JeffAllenNJ reacted to Musashi for a topic
You should better ask this question in the appropriate forumarea of SciTE or AutoHotKey -> https://www.autohotkey.com/boards/ It looks like you have AutoIt and AutoHotKey installed in parallel. Possibly a reinstallation of SciTE4AutoHotkey may help (without guarantee) . EDIT : Have a look e.g. at : using-scite-for-both-autoit-and-autohotkey Since I do not work with AHK, I am sorry that I cannot offer you any further solutions .1 point -
I used this in my project to automatize PatchMaker application. There is no other way to add folder to ListView only by Button which populates standard Windows FileSelectFolder dialog. So I did this helper function which parse desired path to be selected and goes through TreeView control and selects/expands path parts and finally click on OK button. So I share it here for other users. ; note: "Vyhledat složku" is localized standard dialog title on Czech Windows ; on English Windows it will be probably "Select folder" #include <GuiTreeView.au3> ; test code with FileSelectFolder (simulation of another process) Run(@AutoItExe & ' /AutoIt3ExecuteLine "FileSelectFolder(''Select folder test'', '''')"') _SelectFolder("Vyhledat složku", "Select folder test", 'C:\Program Files\Autoit3') Func _SelectFolder($title, $text, $path_to_select) ; last char musn't be '\' If StringRight($path_to_select,1) = '\' Then $path_to_select = StringTrimRight($path_to_select,1) WinActivate($title, $text) WinWaitActive($title, $text) $hTree = ControlGetHandle($title, $text, "SysTreeView321") _ParsePath($hTree, $path_to_select) If @error Then ControlClick($title, $text, "Button2") ; Cancel Exit EndIf ; only test of final selection (not needed) ; uncomment to see final selection ;~ $hNode = _GUICtrlTreeView_GetSelection($hTree) ;~ $path_return = _GUICtrlTreeView_GetText($hTree, $hNode) ;~ MsgBox(0,'Selected node text',$path_return) ControlClick($title, $text, "Button1") ; OK WinWaitClose($title, $text) EndFunc ; parse path to parts and goes through TreeView and selects/expands path parts Func _ParsePath($hTree, $path) $path2 = StringSplit($path, '\') ; first part searching is little nonstandard $tmp = '(' & $path2[1] & ')' ; (C:) $hNext = _GUICtrlTreeView_FindItem($hTree, $tmp, True) If $hNext = 0 Then MsgBox(48,'Error','Not found TreeView node! path=' & $path & ' part=' & $tmp) SetError(1) Return EndIf ; for remaining parts searching is the same For $i = 2 To $path2[0] $found = False _GUICtrlTreeView_Expand($hTree, $hNext) $hNext = _GUICtrlTreeView_GetFirstChild($hTree, $hNext) While $hNext <> 0 If _GUICtrlTreeView_GetText($hTree, $hNext) = $path2[$i] Then $found = True ExitLoop EndIf $hNext = _GUICtrlTreeView_GetNextSibling($hTree, $hNext) WEnd If Not $found Then MsgBox(48,'Error','Not found TreeView node! path=' & $path & ' part=' & $path2[$i]) SetError(1) Return EndIf Next _GUICtrlTreeView_SelectItem($hTree, $hNext) EndFunc EDIT: - 26.8.2008: updated from #include <A3LTreeView.au3> to #include <GuiTreeView.au3>1 point