Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation since 03/06/2025 in all areas

  1. If you want the text scrolling to continue even when you drag the GUI or even when an MsgBox() is in action, you can use _WinAPI_SetTimer instead of AdlibRegister, as in this slightly modified version of your script. ... But if you don't care, then forget it ... #include <GUIConstants.au3> #include <WinAPISysWin.au3> $guiWidth = 300 $hGUI = GUICreate("Main GUI", $guiWidth, 70) $sString = "This is a long string that scrolls smoothly and infinitely in a short label control." ; Create a child GUI for scrolling label $iMargin = 10 $sGap = " " $iLabelWidth = $guiWidth - $iMargin * 2 $hChildGUI = GUICreate("", $iLabelWidth, 20, 10, 10, $WS_CHILD, -1, $hGUI) GUISetFont(12, 400, 0, "Arial") ; Create a label wide enough to hold a long string without truncation $idLabel = GUICtrlCreateLabel($sString, 0, 0, 2000, 20, BitOR($SS_NOPREFIX, $SS_LEFTNOWORDWRAP)) ; Get the string width $tmpLabel = GUICtrlCreateLabel($sString, 0, 0, -1, 20, BitOR($SS_NOPREFIX, $SS_LEFTNOWORDWRAP)) $iStringWidth = ControlGetPos($hChildGUI, "", $tmpLabel)[2] - 9 ; Label is wider than the string width by 9 pixels GUICtrlDelete($tmpLabel) GUISetState(@SW_SHOW, $hGUI) GUISetState(@SW_SHOW, $hChildGUI) ; Update the label data if the string width is larger than the label width If $iStringWidth > $iLabelWidth Then GUICtrlSetData($idLabel, $sString & $sGap & $sString) $iScrollPos = 0 $iMarquee = 0 $iScrollDelay = 40 ; AdlibRegister("_Marquee", $iScrollDelay) ; -- setup timer-- Local $hTimerProc = DllCallbackRegister('_Marquee', 'none', 'hwnd;uint;uint_ptr;dword') Local $iTimerID = _WinAPI_SetTimer(0, 0, $iScrollDelay, DllCallbackGetPtr($hTimerProc)) ; ---------------- EndIf MsgBox(64, "Info", "text scrolls") Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; -- clean timer-- _WinAPI_KillTimer(0, $iTimerID) DllCallbackFree($hTimerProc) ; ---------------- Func _Marquee($hWnd, $iMsg, $iTimerID, $iTime) #forceref $hWnd, $iMsg, $iTimerID, $iTime $iMarquee += 1 If $iMarquee < 3000 / $iScrollDelay Then Return ; 3 seconds of halt when $sString comes to the initial position $iScrollPos -= 1 If - $iScrollPos = $iStringWidth + StringLen($sGap) * 4 Then ; Initialize the $idLabel's position $iMarquee = 0 $iScrollPos = 0 EndIf GUICtrlSetPos($idLabel, $iScrollPos, 0) EndFunc ;==>_Marquee
    4 points
  2. I will check deeply next few days ... don't call the wolf out of the forest
    3 points
  3. This concept was used in my zPlayer to display long file names in a short label control. #include <GUIConstants.au3> $guiWidth = 300 $hGUI = GUICreate("Main GUI", $guiWidth, 70) $sString = "This is a long string that scrolls smoothly and infinitely in a short label control." ; Create a child GUI for scrolling label $iMargin = 10 $sGap = " " $iLabelWidth = $guiWidth - $iMargin * 2 $hChildGUI = GUICreate("", $iLabelWidth, 20, 10, 10, $WS_CHILD, -1, $hGUI) GUISetFont(12, 400, 0, "Arial") ; Create a label wide enough to hold a long string without truncation $idLabel = GUICtrlCreateLabel($sString, 0, 0, 2000, 20, BitOR($SS_NOPREFIX, $SS_LEFTNOWORDWRAP)) ; Get the string width $tmpLabel = GUICtrlCreateLabel($sString, 0, 0, -1, 20, BitOR($SS_NOPREFIX, $SS_LEFTNOWORDWRAP)) $iStringWidth = ControlGetPos($hChildGUI, "", $tmpLabel)[2] - 9 ; Label is wider than the string width by 9 pixels GUICtrlDelete($tmpLabel) GUISetState(@SW_SHOW, $hGUI) GUISetState(@SW_SHOW, $hChildGUI) ; Update the label data if the string width is larger than the label width If $iStringWidth > $iLabelWidth Then GUICtrlSetData($idLabel, $sString & $sGap & $sString) $iScrollPos = 0 $iMarquee = 0 $iScrollDelay = 40 AdlibRegister("_Marquee", $iScrollDelay) EndIf Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func _Marquee() $iMarquee += 1 If $iMarquee < 3000/$iScrollDelay Then Return ; 3 seconds of halt when $sString comes to the initial position $iScrollPos -= 1 If -$iScrollPos = $iStringWidth + StringLen($sGap) * 4 Then ; Initialize the $idLabel's position $iMarquee = 0 $iScrollPos = 0 EndIf GUICtrlSetPos($idLabel, $iScrollPos, 0) EndFunc
    2 points
  4. 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) EndFunc
    2 points
  5. 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)
    2 points
  6. Current Beta should add Include files required by the Master script, ignoring when they are included through an Include file. This is cleaner and less dependent on possible changes in the Includes.
    2 points
  7. No issue, so we would want Tidy to respect that when not ran from SciTE. I have uploaded a Beta version that checks how the program is shelled and will Indent linecomments when not ran from SciTE.
    2 points
  8. WildByDesign

    ACL Viewer

    ACL Viewer (WildByDesign/ACLViewer: ACL Viewer for Windows) This would not have been possible without the amazing support from this forum. I received so much great help and I am thankful. I wanted to give back to the community by sharing what I have come up with. I overcame a lot of challenges. So I am hoping that this (or parts of this) may benefit others. I have other AutoIt-created programs on my GitHub also which I will likely share here in the forum when I have more time to get all the information together. Screenshot: Features: automatic dark mode / light mode depending on system theme settings treeview for selecting files/folders for viewing ACLs listview for displaying parsed ACEs custom ACCESS_MASK parser listviews for displaying permissions with checkboxes Includes: TreeListExplorer by @Kanashius DarkMode UDF originally by @NoNameCode, updated by @argumentum GUIFrame UDF by @Melba23 ACL Permissions UDF originally by @FredAI, updated by @AdamUL There are other functions within the code that I received incredible help on from the forum and I added credits and links within the code.
    2 points
  9. Generally respecting the indentation when commenting or un-commentating a line seems like the best approach in my opinion. Doing it like in SciTE, gives issues, when you want to indent a section containing an out-commented line of code, where with vscode the identation is no issue and un-commentating the line later, does not produce the same possible problems.
    2 points
  10. Well i am actually in favor of including the files required in the master itself and not depend on a possible include in the included file. There is no real clutter as the udf and constant file have a #include_once in them. I probably will change the default and can make it a choice like I've done in the dynamic lua stuff.
    2 points
  11. Open just re-opens the current file at the moment, need to implement a good save and open function soon (work in progress) thanks btw!
    1 point
  12. I tested different delays, and 100 was working for all computers.
    1 point
  13. FYI, I tested on other computers. Older computer reacts correctly as it should be expected. Faster (more recent) computer behave exactly as I am experiencing. So this is not related to my own computer. It seems to be another of those timing issues with AutoIt. Sadly not the first, not the last... For those who face the same problem as I have, here a simple solution : #include <GUIConstants.au3> #include <Constants.au3> Example() Func Example() Local $hGUI = GUICreate("Main GUI", 300, 70) GUISetState() Sleep(100) Local $hGUI2 = GUICreate("", 280, 30, 10, 10, $WS_CHILD, -1, $hGUI) GUISetFont(11) Local $idLabel = GUICtrlCreateLabel("This is a test", 0, 0, 100, 30) GUISetState() MsgBox($MB_OK, "", "Test") Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>Example Slow down the creation of child GUI by putting a Sleep in between. It is working on all computers correctly now.
    1 point
  14. @WildByDesign Thank you very much for the praise, I am glad you like it :). And thanks for finding the bug, I fixed it. It was a missing check for $sPath="" in __TreeListExplorer__OpenPath when checking if the path is a file (and then splitting it), that did overwrite the $sSelect to empty. I also checked, if it is possible to select multiple files/folders, which is working with ListViews and not causing any problems. So I added that to the example. (It looks like it is not possible to enable multiselection for TreeViews, if I did not overlook something... Only thing I saw was enabling checkboxes).
    1 point
  15. @WildByDesign I made up my mind and removed the single click expand/collapse. It is now done with a double click. This makes the managing of the selection a lot easier. It is now possible to select folders in the TreeView :). I used the change to adjust the callback parameters to include the selection and added some additional information that was missing (selected index/item handle for clicks; The current path when loading).
    1 point
  16. $WS_EX_COMPOSITED seems to help reduce flickers when the adlib time is set to 25. When the time is set to 40, it doesn't seem to help. Maybe it's due to my bad eye sights. Thanks for the hint anyway. As to the string size, creating a temporary label with width set to -1 seems to give precise width. I tried it with diferrent languages and different font weights, and so far, I am happy with the results. According to my observations, the label width is always 9 pixels longer than the actual string size.
    1 point
  17. 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
  18. @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
  19. I have not checked Logan's extension, but in mine i have not yet implemented any folding information provider 😉
    1 point
  20. 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
  21. 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
  22. Great, thanks SOLVE-SMART! I will give that code a try in the future and keep note of it. However, I was anxious so just simply switched to Bing Translate which worked fine with the geckodriver.
    1 point
  23. 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
  24. I update SciTE w/newer beta files with this script so otherwise it brakes my automation 😅
    1 point
  25. Thanks... fixed in Beta downloads, but is really not needed to download as the installer only updates au3check.exe to support the mixed encoding, but will use the available au3check.dat.
    1 point
  26. The new Au3Check.dat is missing data ( Maps, SetExitCode, etc. ) Fixed
    1 point
  27. So another vscode extension for the AutoIt language emerges! I've tried the existing ones, and found small problems that i felt i could improve on, but it would require an entire new approach to the inner working of the existing extensions. Also working on a complete AutoIt3 parser a vscode extension just made sense Any feedback is appreciated, and i hope this project will benefit more than just me 🤡 Visual Studio Code Marketplace GitHub repo Some of the current features: Basic AutoIt2 syntax highlighting, for fun 🤡 AutoIt3 syntax highlighting Variable/Function hover gives declaration information if available. Goto declaration #include links Syntax checking, as you type Function signature help Function and variable list in a file via the outline tab. Works on desktop (any OS) and web version ⚠️ The parser used is not yet 100% complete (see issues for know problems), and the last thing to be implemented is the With code block. Hope you like 😃
    1 point
  28. I'm a dummy, I thought I was using your extension! I am now though .. I'll let you know how it goes!
    1 point
  29. WildByDesign

    ACL Viewer

    I agree 100%. And that is probably the way that I have learned the most at every aspect of life. Taking things apart, breaking things and figuring it out later. I will definitely read that Best coding practices tonight. Cheers!
    1 point
  30. Nine

    ACL Viewer

    Personally I dislike declaring variables between includes. It should be declared inside the included file. All UDF should be auto-sufficient. No offense. edit : if you need to share a global variable between UDF, the source UDF should provide a function to retrieve that variable instead of relying on the knowledge of a variable name...
    1 point
  31. WildByDesign

    ACL Viewer

    Thank you for mentioning this. I will have it fixed in the next build. This is really neat. I am still very new to AutoIt, so I had never thought of adding some Global variables before specific includes. It works great, thank you. It changed my way of thinking as well since being a script, it goes in order line by line. That way it is declared before the other include is loaded. This seems so simple, yet I did not know. So I appreciate it. Also thank you for the simplification of the dark mode function, that is incredible. This makes me excited to learn more about AutoIt and improve my abilities.
    1 point
  32. argumentum

    ACL Viewer

    ... #include <Misc.au3> Global $isDarkMode = False Global $sRet, $aRet, $newItem, $oldItem, $isFolder, $aUniques, $TV_Icons #include "include\GUIFrame.au3" ... would solve that. But also: ;~ isDarkMode() ;~ Func isDarkMode() ;~ Global $isDarkMode = _WinAPI_ShouldAppsUseDarkMode() ;~ EndFunc ;==>isDarkModeisDarkMode() ;------------------------------------------------------------- ;~ Global $isDarkMode = isDarkMode() ;~ Func isDarkMode() ;~ Return _WinAPI_ShouldAppsUseDarkMode() ;~ EndFunc ;==>isDarkMode ;------------------------------------------------------------- Global $isDarkMode = _WinAPI_ShouldAppsUseDarkMode() ;------------------------------------------------------------- this could be simplified. Using #AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 would force you to confront these things. At one year old ( you joined less than a year ago ), your script is better than I ever did at 1 year old. Thanks for sharing @WildByDesign
    1 point
  33. The _arraydisplay shouldn't happen and is there for my debugging during development, fixed that in the current version of the preview. Does au3check tell you all is fine, or do you get an error? Reason for the question is that currently, in case the #include file is already included through another include, it will not be added to the master. This is a different behavior than the default Dynamic Includes does and equals: #SciTE4AutoIt3_Dynamic_Include_recursive_check=y It can be changed to work the same as Dynamic includes version and include all in the master, ignoring the recursive includes.
    1 point
  34. It works good Jos! Thank you! I tested it briefly using this in the LibreOffice development folder: _LOCalc_CellFontColor() MsgBox($MB_OK, "", "") _Word_Create() and it took ~7 seconds before the ArrayDisplay came up. Which is pretty quick I would say! And then some weird output message in the Terminal (This could be my own problem, as I occasionally have display issues with VSC.). But I can't reproduce this after the first two times. But the ArrayDisplay sometimes comes up with this script. I then tested with this: _LOCalc_CellFontColor() MsgBox($MB_OK, "", "") _Word_Create() _LOWriter_VersionGet() And it took ~8 seconds, but missed the MsgBox Constants. However no array display, and only normal messages in the terminal. Edit: Tried it again and it took 5 seconds. Msg Box constants still don't get added with the lower script.
    1 point
  35. @Nine Is it counted as spoon-feeding solution? If you ask me, what I have attempted to solve this issue, i stuck, no clue for this. How can you easily accuse me that I only want spoon-feeding solution? There is also another post/thread I create below he gives me example to look and learn from his github about how to deal with my problem. Is it also counted as spoon-feeding solution? I'm really sorry because I don't know that it is I only hope that if someone doesn't want to give the answer, at least give some clue so that I can learn by myself. No offense at all Thank You
    1 point
  36. Anything is possible when you put your mind to it and have some time to burn. 🙂 preview version: https://www.autoitscript.com/autoit3/scite/download/beta_SciTE4AutoIt3/addincludes/AutoIt3Wrapper.au3 It scans for any potential Include files *.au3 file that contain a Func names with format _*.au3 and *Constants*.au3 files for Global Const $vars defined in these paths: @Scriptpath @Scriptpath\include @AutoIt3Dir\include Any defined private include directories in RegRead("HKCU\Software\AutoIt v3\Autoit", "Include") It takes a couple of seconds for me to read all include files for UDFs & Vars and then depending on the script size again a few seconds to check if any #include is required and found/known. Maybe some can try it to see how it performs on their systems.
    1 point
  37. Kanashius

    ToString UDF

    This is an UDF to print the content and type of any variable. This includes basic datatypes, as well as all data in multidimensional arrays, DllStructs, Maps, some Objects like Dictionaries,... Basically any datatype I could think of. By Default, the datatype is given, this can be turned of. Additionally the spacing can be tuned to ones liking. I hope you like it and feel free to provide some feedback for improvement. Example: Output: ToString.au3 ToString Example.au3
    1 point
  38. Dears, i am trying to come up with my own c/++ dll to connect autoit with mongodb or similar (without ADO). The goal is to exchange "unmodified" strings between autoit and my dll, we want to migrate a very large autoit application from using the filesystem as a database to a real database (potentially hundreds of thousands files are written and listed/read...), not yet sure if it really pays off to go the dll approach is worth it. One very simple alternative would be to use some http rest api bridge to talk with the database but this adds a little overhead because of the http protocol. The result of my tests below is as you see in the .au3 comments, the "Add" function call works including parameters and return int but the "Echo" functions parameter wchar_t* is always 0. Any clues be greatly appreciated! Besides some old forum posts i did not really find any examples how to pass string or binary data unmodified between dlls and autoit... test.au3: #AutoIt3Wrapper_UseX64=Y Global Const $g_sFileDll      = 'C:\dev\FileBridge++\FileBridge++\x64\Debug\FileBridge.dll' $hdll = DllOpen($g_sFileDll) #this works, $test is 5 $test = DllCall($hdll, "int:cdecl", "Add", "int", 2, "int", 3) #this works, we get a console print in scite and the messagebox initiated by dll pops up $test = DllCall($hdll, "int:cdecl", "Function", "int", 2, "int", 3) #this does not work, we only get 0 pointer int the dll $utf16String = "Hello, World" $ptr = DllStructCreate("wchar_t [" & StringLen($utf16String) + 1 & "]") ; +1 for null terminator DllStructSetData($ptr, 1, $utf16String) DllCall($hdll, "int", "Echo", "ptr", DllStructGetPtr($ptr)) DllClose($hdll) C++ Part: FileBridge++.h: #include <wchar.h> #define DLL_EXPORT #if defined DLL_EXPORT #define DECLDIR __declspec(dllexport) #else #define DECLDIR __declspec(dllimport) #endif int CppAdd(int a, int b); extern "C" {     // Declare all functions here     DECLDIR void Function(void);     DECLDIR int Add(int a, int b);     DECLDIR void Echo( wchar_t* utf16String);  // Function takes a pointer to MyStructure } FileBridge++.cpp: #include "pch.h" #include <iostream> #include <Windows.h>  #include "FileBridge++.h" using namespace std; extern "C" {     DECLDIR int Add(int a, int b)     {         return CppAdd(a, b);     }     DECLDIR void Function(void)     {         std::cout << "DLL Called! Hello AutoIt!" << std::endl;         MessageBox(0, TEXT("This MsgBox is created by the dll"), TEXT("Simple Dll..."), 0);     }     DECLDIR void Echo(wchar_t* utf16String)     {         if (utf16String == nullptr) {             std::wcout << L"Received NULL pointer!" << std::endl;             return;         }         std::wcout << L"You wrote: [" << utf16String << L"]" << std::endl;              } } int CppAdd(int a, int b) {     return(a + b); }
    1 point
  39. p4sCh

    SSH UDF

    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.zip
    1 point
  40. TL;DR: Create_Process calls cmd.exe if passed a .bat or .cmd file, however the non-standard character escaping of cmd.exe allows arbitrary code execution. NVD - CVE-2024-24576 (nist.gov) https://flatt.tech/research/posts/batbadbut-you-cant-securely-execute-commands-on-windows
    1 point
  41. Sounds like a cool project Just wanted to give you some advice regarding the host, free hosts are very shady so be careful with those. Since your project is open-source you can use Tux Family for hosting, they provide their services at no cost for FOSS projects If you want a generic host I'd recommend Uberspace.de, they have a pay-what-you-want model, so you can pay as low as 1 EUR/month, that's what I use for my hosting since it doesn't really get a lot of traffic. The recommended amount is 5 EUR. They also do good work by defending free software in actual courts (see the YouTube-DL case in Germany)
    1 point
  42. Which directory did you exclude? Did you also exclude this directory: %localappdata%\AutoIt v3\Aut2exe ? Did you check your AV logs for any activities?
    1 point
  43. In some situations, compiling may request a temp file in user folder. You would need to also set the whole directory as an exception.
    1 point
  44. Hey Guys! I am currently trying to automate making icons for my small fan made game. Basically i just take a screenshot of a 3D Model in 32x32 and remove the BG color via Photoshop, then saving it as .png. Atm my script creates a rectangle to visually show me the area of the screenshot and hides the rectangle once it takes a screenshot: $Rectangle = GUICreate("Test", 32, 32, 1358, 438,$WS_POPUP,$WS_EX_TOPMOST) GUISetState(@SW_SHOW) WinSetTrans($Rectangle, "", 150) HotKeySet("{DOWN}" , "close") HotKeySet("{UP}" , "TakeScreenshot") Global $funcs = False While 1 If $funcs = True Then ToolTip("Cheeeseee" , 0 , 30) Sleep(10) GUISetState(@SW_HIDE, $Rectangle);Hide rectangle _ScreenCapture_Capture("C:\Users\PAT\Pictures\Item" & "\Test.jpg", 1358, 438, 1390, 470);Take Screenshot and save the Picture GUISetState(@SW_SHOW, $Rectangle);Unhide rectangle $funcs = False EndIf WEnd Func close() ToolTip("Closing..." , 0 , 30) Sleep(200) Exit EndFunc Func TakeScreenshot() If $funcs = False Then $funcs = True Else $funcs = False ToolTip("Ready!" , 0 , 30) EndIf EndFunc The Screenshot it takes looks like this: But i want it to look like this(transparent background): How would you guys do it? I'm pretty new to GDI and graphics related stuff in AutoIT so i have no clue what to do 😕 Any help would be really appreciated! Edit: Alright i found a solution! I've used this script from @UEZ to make it work like intended. Thanks to UEZ! ♥ ;benötigt 3.3.12.0 #include <ScreenCapture.au3> _GDIPlus_Startup() Global $iWidth = 400, $iHeight = 400 Global $hBitmap_GDI = _ScreenCapture_Capture("", 0, 0, $iWidth - 1, $iHeight - 1, 0) Global $hBitmap_GDIPlus = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap_GDI) Global $hBitmap_Result = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight) Global $hBitmap_Result_Ctxt = _GDIPlus_ImageGetGraphicsContext($hBitmap_Result) Global $aRemapTable[2][2] $aRemapTable[0][0] = 1 $aRemapTable[1][0] = 0xFFFFFFFF ;Farbe, die Transparent gemacht werden soll $aRemapTable[1][1] = 0x08000000 ;Semi Transparenz - Format 0xAARRGGBB Global $hIA = _GDIPlus_ImageAttributesCreate() _GDIPlus_ImageAttributesSetRemapTable($hIA, 1, True, $aRemapTable) _GDIPlus_GraphicsDrawImageRectRect($hBitmap_Result_Ctxt, $hBitmap_GDIPlus, 0, 0, $iWidth, $iHeight, 0, 0, $iWidth, $iHeight, $hIA) _GDIPlus_ImageSaveToFile($hBitmap_Result, @ScriptDir & "\Result.png") _GDIPlus_GraphicsDispose($hBitmap_Result_Ctxt) _GDIPlus_BitmapDispose($hBitmap_GDIPlus) _GDIPlus_BitmapDispose($hBitmap_Result) _WinAPI_DeleteObject($hBitmap_GDI) _GDIPlus_ImageAttributesDispose($hIA) _GDIPlus_Shutdown() ShellExecute(@ScriptDir & "\Result.png") Func _GDIPlus_ImageAttributesSetRemapTable($hImageAttributes, $iColorAdjustType = 0, $fEnable = False, $aColorMap = 0) Local $iI, $iCount, $tColorMap, $aResult If IsArray($aColorMap) And UBound($aColorMap) > 1 Then $iCount = $aColorMap[0][0] $tColorMap = DllStructCreate("uint ColorMap[" & $iCount * 2 & "]") For $iI = 1 To $iCount $tColorMap.ColorMap((2 * $iI - 1)) = $aColorMap[$iI][0] $tColorMap.ColorMap((2 * $iI)) = $aColorMap[$iI][1] Next $aResult = DllCall($__g_hGDIPDll, "int", "GdipSetImageAttributesRemapTable", "handle", $hImageAttributes, "int", $iColorAdjustType, "int", $fEnable, "int", $iCount, "struct*", $tColorMap) If @error Then Return SetError(@error, @extended, False) If $aResult[0] Then Return SetError(10, $aResult[0], False) Return True EndIf Return SetError(11, 0, False) EndFunc ;==>_GDIPlus_ImageAttributesSetRemapTable
    1 point
  45. Hello. Do it like this. (Start-Process App.exe -PassThru -Wait).ExitCode Saludos
    1 point
  46. Unfortunately the OSVersion info doesn't provide enough information especially when dealing with multiple build versions of Windows 10 in our environment, as some of our software doesn't work across all builds (usually because some features are only available on specific builds): OS Versions: 7, 10, 2008 R2, 2012 R2, 2016, 2019 OS Editions: Home, Professional or Enterprise OS Builds: 1709, 1803, 1809, 1903, 1909 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion can usually be used to determine most of this info, however WMI is generally more consistent when running across multiple OS versions. Global $g_sOSCaption, $g_sOSVersion _GetOSInfo() ConsoleWrite("OS Caption : " & $g_sOSCaption & @CRLF & "OS Version : " & $g_sOSVersion & @CRLF) Func _GetOSInfo() Local $oSystemSet = ObjGet("winmgmts:").InstancesOf ("Win32_OperatingSystem") If IsObj($oSystemSet) Then For $oSystem In $oSystemSet $g_sOSCaption = $oSystem.Caption $g_sOSVersion = $oSystem.Version Next EndIf EndFunc
    1 point
  47. 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
  48. #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 EndFunc
    1 point
×
×
  • Create New...