Leaderboard
Popular Content
Showing content with the highest reputation on 03/11/2025 in all areas
-
FileExplorer Treeview and Listview (TreeListExplorer)
Kanashius reacted to WildByDesign for a topic
I wonโt be able to test this new update until later tonight. But itโs interesting that you mention disabling the expanding when clicking. With each release, I disable that single-click expanding functionality because it was weird to single-click to expand and have to double-click to collapse. So I always modified it to get rid of the single click expand. Anyway, thank you for the update. I will test later tonight and provide some feedback.1 point -
FileExplorer Treeview and Listview (TreeListExplorer)
WildByDesign reacted to Kanashius for a topic
@WildByDesign Thanks for the feedback. To be fair, it was more of a bug then a missing feature, because not the folder of the file was reloaded, but the last current folder... The current folder was not changed, when a file was selected. I fixed this by having the file/folder selection handled by the system. This way, a reload refreshes the folder and reselects the currently selected file (or folder in a listview). To support this better, it is now possible to select a file (Tree-/ListView) or folder (ListView) with __TreeListExplorer_OpenPath($hSystem, Default, "coolFile.txt"). Additionally there is now a __TreeListExplorer_GetSelected method to check, what is currently selected. I am currently thinking about moving the $sCallbackOnSelectionChange from the __TreeListExplorer_AddView to the __TreeListExplorer_CreateSystem function, because that is handled there now, synchronized between all views... But I am a little unsure, because it would not be possible to send events for TreeView folder selections through that. So then the folder selection of the treeview would have to be handled by the $sCallbackFolder and the file selection by the new select callback, which would be a bit messy ๐ The ability of a TreeView to expand/collapse when clicking on an item (/selecting an item) is a littlebit annoying to be honest ๐ Maybe I should have disabled that... but I wanted to keep the default functionality...1 point -
Understand what you mean now. Here a new version with no flickers. It uses a similar approach of yours. #include <GUIConstants.au3> Local $hGUI = GUICreate("Main GUI", 300, 70) Local $sString = "This is a long string that scrolls smoothly and infinitely without flickers..." GUISetState() Global $iLen = StringLen($sString) * 6.5 ; <<<<< adjust as needed or use M23 UDF StringSize for more precision Local $hGUI2 = GUICreate("", 280, 30, 10, 10, $WS_CHILD, $WS_EX_COMPOSITED, $hGUI) GUISetFont(11) Global $idLabel1 = GUICtrlCreateLabel($sString, 0, 0, $iLen, 30, $SS_LEFTNOWORDWRAP) Global $idLabel2 = GUICtrlCreateLabel($sString, $iLen, 0, $iLen, 30, $SS_LEFTNOWORDWRAP) GUISetState() AdlibRegister(Scroll, 25) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func Scroll() Local Static $iPos = 0 $iPos -= 1 If -$iPos >= $iLen Then $iPos = 0 GUICtrlSetPos($idLabel1, $iPos) GUICtrlSetPos($idLabel2, $iLen + $iPos) EndFunc1 point
-
Here my take on it : #include <GUIConstants.au3> Local $hGUI = GUICreate("Main GUI", 300, 70, -1, -1, -1, $WS_EX_COMPOSITED) Global $sString = "This is a long string that scrolls smoothly and infinitely in a short label control." Global $idLabel = GUICtrlCreateLabel("", 10, 10, 280, 30, $SS_LEFTNOWORDWRAP) GUICtrlSetFont(-1, 11) $sString &= " " ; pad with space GUICtrlSetData($idLabel, $sString) GUISetState() AdlibRegister(Scroll, 150) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func Scroll() Local Static $iPos = 0, $sScroll = $sString, $iLen = StringLen($sString) $iPos = Mod($iPos, $iLen) + 1 $sScroll = StringTrimLeft($sScroll, 1) & StringMid($sString, Mod($iPos - 1, $iLen) + 1, 1) GUICtrlSetData($idLabel, $sScroll) EndFunc No flicker on my side...1 point
-
Not sure I understand what you are asking. \fs17 means a font size. \par is for paragraph. (notice it is a back slash, not a slash) The code I suggested simply remove the last \par. There is no harm to have a font size at the end. If you want to learn about rtf encoding, you can refer to this.1 point
-
Nice mate. its possible to reduce the flicker a bit by double buffering. So hope you don't mind - but here's another approach #include <GUIConstants.au3> #include <GDIPlus.au3> #include <WinAPI.au3> Global $iGUIWidth = 300 Global $hGUI = GUICreate("Main GUI", $iGUIWidth, 70) Global $sString = "This is a long string that scrolls smoothly and infinitely in a short label control." Global $iLabW = $iGUIWidth - 8, $iLabH = 30 ;The border style is here to mark the label boundry - for demo purposes! Global $hLabel = GUICtrlCreateLabel("", 4, 4, $iGUIWidth - 8, $iLabH, $WS_BORDER) GUISetState() Global $hLabGraphic, $hBuffGraphic, $hBuffBitMap Global $hBrush, $hFormat, $tLayout, $hFamily, $hFont, $iBkColour _GDIPlus_Startup() ;Graphic of the static control - its possible to draw directly to this, but we'll introduce flicker. $hLabGraphic = _GDIPlus_GraphicsCreateFromHWND(GUICtrlGetHandle($hLabel)) ;Create Buffer - Draw to this. Copy to the label once the image is complete. $hBuffBitMap = _GDIPlus_BitmapCreateFromGraphics($iLabW, $iLabH, $hLabGraphic) $hBuffGraphic = _GDIPlus_ImageGetGraphicsContext($hBuffBitMap) ;Create font etc.. $hBrush = _GDIPlus_BrushCreateSolid(0xFFAA0000) ;ARGB $hFormat = _GDIPlus_StringFormatCreate() $hFamily = _GDIPlus_FontFamilyCreate("Arial") $hFont = _GDIPlus_FontCreate($hFamily, 12, 3) ;Size, Italic + Bold $iBkColour = BitOR(0xFF000000, _WinAPI_GetSysColor($COLOR_3DFACE)) ;dialog background colour. ; ----- Find dims of the text. --------- Global $iMargin = 4 $tLayout = _GDIPlus_RectFCreate($iMargin, 0, 1, 1) ;Text rectangle. Margin of 4 from left Local $aStrMeasure[4] ;Expand height until we can fit 2 lines ;Sanity checks are required here! This'll break if there's < 2 printable characters in the string. Do $tLayout.Height += 1 $aStrMeasure = _GDIPlus_GraphicsMeasureString($hLabGraphic, $sString, $hFont, $tLayout, $hFormat) Until $aStrMeasure[2] = 2 $tLayout.Height -= 1 ; Gets us the max height of 1 line. ;Expand width until we can fit the entire string. Do $tLayout.Width += 1 $aStrMeasure = _GDIPlus_GraphicsMeasureString($hLabGraphic, $sString, $hFont, $tLayout, $hFormat) Until $aStrMeasure[1] = StringLen($sString) ;Center vertically in the label $tLayout.Y = Floor(($iLabH - $tLayout.Height)/2) ConsoleWrite(StringFormat("text dims: [%d, %d, %d, %d]\r\n", $tLayout.X, $tLayout.Y, $tLayout.Width, $tLayout.Height)) ;-------------------------------------- ;Initial write to label - cause I'm too lazy to fix scrolling logic! _GDIPlus_GraphicsDrawStringEx($hLabGraphic, $sString, $hFont, $tLayout, $hFormat, $hBrush) Local $hTimer = TimerInit(), $iShift = 3 ; $iShift = Pos shift on each iteration. While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop ;Pause at string start. If TimerDiff($hTimer) < 2000 Then ContinueLoop ;wipe buffer _GDIPlus_GraphicsClear($hBuffGraphic, $iBkColour) ;Redraw the string at new position. $tLayout.X -= $iShift If ($tLayout.X + $tLayout.Width) < 0 Then ;If we've fallen off the label.. $tLayout.X = $iMargin ;Start at our initial position $hTimer = TimerInit() EndIf _GDIPlus_GraphicsDrawStringEx($hBuffGraphic, $sString, $hFont, $tLayout, $hFormat, $hBrush) ;Copy the buffer to the label _GDIPlus_GraphicsDrawImageRect($hLabGraphic, $hBuffBitMap, 0, 0, $iLabW, $iLabH) Sleep(40) WEnd ;Cleanup _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hBuffGraphic) _GDIPlus_ImageDispose($hBuffBitMap) _GDIPlus_GraphicsDispose($hLabGraphic) _GDIPlus_Shutdown() GUIDelete($hGUI)1 point
-
Uploaded an Updated SciTE4AutoIt3_vsc.exe installer with the changes made since the previous version: 10-3-2025 *** Merged the SciTE v 5.5.5 by Neil Hodgson with our own version of SciTE. (Jos) *** Updated Au3Stripper v25.205.1420.x (Jos) - 25.205.1420.1 Fixed: / changed ANSI & UTF8 detection and convert all to utf8 in the outputfile (8/03/2025) - 25.205.1420.3 Added: /AS /Aut2exeSource option which will generate a sourcefile as included at compilation time (9/03/2025) *** Updated AutoIt3Wrapper v25.205.1420.x (Jos) - 25.205.1420.1 Disable HotKey Error when defined as "" in INI (10/02/2025) - 25.205.1420.7 Update addinclude function (4/03/2025) - 25.205.1420.8 Will now add any required UDF or Var includefile required by the Master, ignoring lower recursive level checking (9/03/2025) *** Updated SciTE/Lua/ (Jos) - Merged Header changes from donnyh13 back into AutoIttools.lua (10/02/2025) - Changed: Dir command so it will also list filenames with special characters. (10/02/2025) *** Updated SciTEConfig v25.205.1420.x (Jos) - 25.205.1420.1 Added: Toggle between SciTE & VSCode (7/02/2025) *** Updated Tidy v25.205.1420.x (Jos) - 25.205.1420.1 Change Indentation of linecomments to indent the same as the other lines, when not ran from SciTE.1 point
-
SSH UDF
PatricWust reacted to p4sCh for a topic
Hello everyone, I've created a UDF for basic communication with SSH servers. I know there is already such a UDF, but I wasn't satisfied with it for my purpose, so I created a new one. This UDF also acts as a wrapper for the plink executable. Its essential functions are _SSHConnect, _SSHSend, _SSHRecv and _SSHCloseSocket. It does support multiple simultaneous connections and aims to be pretty robust. Feel free to share your opinions Two of the included examples use a slightly modified version of Vintage Terminal by @Chimp Download The download includes ssh.au3 (UDF), plink.exe (necessary), vintage terminal and code examples: Version 1.0.1 - fixed rare _SSHConnect bug where "ssh-host-key prompt" was not answered SSH UDF 1.0.1.zip1 point -
Basically, here's how I (KaFu and jchd) solved my problem using the Main Script: $struct = "wchar ins[260]" $Structure=DllStructCreate($struct) If @error Then MsgBox(0,"","Error in DllStructCreate " & @error); Exit Endif ; Get the pointer $Pointer1 = DllStructGetPtr($Structure,"ins") ; Returns the pointer ; Initialize default value Write_Memory(@AutoItPID, $Pointer1, "null", "wchar var4[260]") ; Build a list of the test to be executed $aTestList = _FileListToArray("C:\TestCases\Execution\") ; Loop through the test list For $i = 1 To $aTestList[0] Run("C:\Program Files\AutoIt3\AutoIt3.exe C:\TestCases\Execution\" & $aTestList[$i] & " " & @AutoItPID & " " & $Pointer1, "C:\Program Files\AutoIt3\") ; Script waits while TestCase script modify the shared variable including all details about the testcase. While Read_Memory(@AutoItPID, $Pointer1, "wchar var4[260]") = "null" Sleep(100) WEnd ; TestCase script return a result and Report_Format prepare the string for SQL INSERT. $aValues = Report_Format(Read_Memory(@AutoItPID, $Pointer1, "wchar var4[260]")) ; INSERT into Memory Database using value retrieved from the shared string variable. If Not _SQLite_Exec (-1, "INSERT INTO Tests VALUES ('" & $aValues[1] & "','" & $aValues[2] & "','" & $aValues[3] & "','" & $aValues[4] & "','" & $aValues[5] & "');") = $SQLITE_OK Then _ MsgBox(16, "SQLite Error", _SQLite_ErrMsg ()) ; Set shared variable's value back to "null" Write_Memory(@AutoItPID, $Pointer1, "null", "wchar var4[260]") Next TestCase call is made really simple using Report_Write(): Report_Write($CmdLine[1], $CmdLine[2], $aTD, "001", "Pass") Func Report_Write($PID, $Pointer, $aTD, $step, $status) Write_Memory($PID, $Pointer, _ $aTD[0] & "|" & _ ; Test Category $aTD[1] & "|" & _ ; Test ID $aTD[2] & "|" & _ ; Test Title $step & "|" & _ ; Test Step $status, _ ; Step Status "wchar var4[260]") EndFunc Main Script calls Report_Format, converting the shared string to array using StringSplit. (Depending on my future needs, I may change the workflow to use multiple pointer to different data type instead of a single string.) That's not much of an innovation but it might gives idea for using a "shared" SQLite database.1 point
-
Cannot delete ListView columns using For loop...
VenusProject2 reacted to Authenticity for a topic
#include <GuiConstantsEx.au3> #include <GuiListView.au3> Dim $hGUI = GUICreate('Test', 300, 400) Dim $hListView = _GUICtrlListView_Create($hGUI, '1|2|3|4|5|6|7|8|9|10|11|12|13|14|15', 0, 0, 300, 300) Dim $Button = GUICtrlCreateButton('Delete', 215, 340, 70, 25) GUISetState() While 1 Switch GUIGetMsg() Case -3 ExitLoop case $Button DeleteColumns($hListView) GUICtrlSetState($Button, $GUI_DISABLE) EndSwitch Sleep(40) WEnd GUIDelete() Func DeleteColumns($hLV) Local $iColumn = _GUICtrlListView_GetColumnCount($hLV) For $i = $iColumn-1 To 0 Step -1 _GUICtrlListView_DeleteColumn($hLV, $i) Next EndFunc1 point