Leaderboard
Popular Content
Showing content with the highest reputation on 06/05/2022 in all areas
-
https://www.autoitscript.com/autoit3/files/beta/autoit/autoit-v3.3.16.1-rc1-setup.zip https://www.autoitscript.com/autoit3/files/beta/autoit/autoit-v3.3.16.1-rc1.zip 3.3.16.1 (xxx, 2022) (Release) AutoIt: - Fixed #3866: REGEXPCLASS broken in 3.3.16.0. - Fixed #3875: GUICtrlSetResizing() performance. - Fixed #3865: Image Control resizing behave as forced $GUI_DOCKWIDTH and $GUI_DOCKHEIGHT. - Fixed #3764: StringRegExp() crash with patterns that cause infinite recursion. - Fixed #3876: Hex Number Arithmetic is incorrect. - Fixed #3879: Dim Map to Array. UDFs: - Fixed #3867: Changes in 'SecurityConstants.au3' to avoid name conflict. THIS IS A SCRIPT BREAKING CHANGE - Added: UBound[2] example. - Added: StringRegExp[5] example. - Added: _GUICtrlEdit_SetPadding() function and example. - Fixed: Regression in 3.3.15.1, _WinAPI_RegCreateKey() and _WinAPI_RegOpenkey(). - Added: _WinAPI_RegDeleteKey() can use $hKey as in RegRead(). - Fixed: Regression of #3835 on _GDIPlus_GraphicsGet*(). - Fixed #3871: _ArrayDisplay() Hang sorted array with Null element. - Fixed: _FTP_FileGetSize() very big size. - Fixed #3872: FTP-Server in AutoIt Help no longer accessible. - Fixed #3877: GUICtrlCreateLabel() overlapping controls doc precision ($WS_CLIPSIBLINGS). - Added #3863: _WinAPI_GetCapture(). - Added: Allows _DebugArrayDisplay() to be used in UserFunc. - Added: _ArrayDisplay() and _DebugArrayDisplay() support Min Column width. - Added: _Array2DCreate() support 1D and/or 2D arrays. - Added: _DebugReportVar() display DllStruct content. - Fixed #3883: _DebugArrayDisplay() produces uncalled console message. - Added: _ArrayDisplay() and _DebugArrayDisplay() display {Array[dims]}, {Map[nentry]} and {Object}.2 points
-
@kcvinu No worries, glad that you were able to figure it out Thank you!1 point
-
GuiBuilderPlus [updated March 24, 2024]
argumentum reacted to kurtykurtyboy for a topic
Point taken.. I'm not old enough to be stuck in my ways. I poked around that UDF and can see how that would be a lot simpler/cleaner than the user manually scaling each control. The idea is you feed it all your controls and let the UDF do the resizing as needed. I'm starting to see your point. If this is done via a UDF, then there is no point in scaling each control, which means I can remove that functionality from GuiBuilder, which means that picking up this project was pointless since that was my whole reason for starting this! You've now convinced me to quit. Just kidding, I'll keep going. I've been growing quite fond of it as things become more and more stable. Now to decide if that existing DPI UDF is good enough or if we need to enhance or improve it... but that's for another discussion I suppose.1 point -
GuiBuilderPlus [updated March 24, 2024]
argumentum reacted to kurtykurtyboy for a topic
...deleting my long-winded reason for the AU3 exe path. Thanks for the example, that makes a lot of sense now.1 point -
My Roku's remote control stopped working so I ordered a new one. Since I use my Roku for almost all of my TV watching (local channels, movies, etc.), I had to find a way to control the device until the new remote got delivered. That was the genesis of this simple little script. The script uses Roku's External Control Protocol (ECP), which is a set of RESTful API's that allow an application to control any Roku device that can by reached across a network. The API's implemented in this example script are just a small subset of ECP's full capabilities. One benefit of using ECP instead of a physical remote is that there are no distance or line-of-site restrictions. As long as there's network connectivity to the Roku devices, you can control them from anywhere. It was a fun little project that only took about an hour. Even though it's a simple little script, it was invaluable while I was waiting for my new Roku remote. If you ever find yourself without your Roku remote, you'll see. ;========================================================================== ; ; DESCRIPTION ; ; This is high-level example of a simple Roku remote control using Roku's ; External Control Protocol (ECP) REST API's. ; ; There are two interesting technical aspects of the script. The first is ; a simple implementation of the Simple Service Discovery Protocol (SSDP) ; which, in this case, finds all of the Roku devices on the current subnet. ; The second is the sending and processing RESTful HTTP API's. ; ; ; USAGE ; ; When the script starts, either enter a known Roku IP:PORT address or ; you can select one from the list after doing a successful device ; discovery. After entering or selecting the IP:Port of the Roku device ; that you would like to communicate with, you can click on any of the ; visible Roku remote control buttons and the related command will be sent ; to that device using the ECP RESTful API's. ; ; ; NOTE ; ; Roku's default ECP port is 8060. So an example IP:Port would be something ; like "192.168.1.25:8060". ; ; I used one of the simplest Roku remote control layout images. However, ; some Roku devices still may not recognize some of the buttons. For ; example, the volume & power buttons are mostly recognized by Roku TV's, ; not the standalone streaming devices. You can click the ; "Show Device Info" button, once you have a valid IP:PORT entered, to ; see what functionality your device supports. ; ;========================================================================== Roku Remote Example v1.1.0 by TheXman.zip1 point
-
Most of these issues related to GDI and GDI+ code is about memory leaks. That's also the case here. There are two memory leaks in the code: neither $CTR_hMyFont[0] nor $CTR_hRgn2[0] are deleted using the DeleteObject() function. Fix these errors and the code will probably run forever. I would write the code this way: #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_UseX64=Y Opt( "MustDeclareVars", 1 ) #include <GUIConstants.au3> Example() Func Example() Local $text = "Next action in " ; Info text to show on screen Local $txtcolor = 0xFF0000 ; Text color Local $printInfo = 1 ; Show info text at all? Local $delay = 0.0 Local $hwnd = GUICreate("Text Region", 800, 200, 10, 10, $WS_POPUP, BitOR($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW)) GUISetBkColor($txtcolor) ; text color GUISetState() While 1 Local $time = TimerInit() do If $printInfo Then CreateTextRgn($hwnd, $text & Round(($delay - TimerDiff($time))/1000) & "s", 100, "Arial", 500) Sleep(100) until TimerDiff($time) >= $delay $delay = Random(52,71,1)*1000 Action() WEnd EndFunc Func CreateTextRgn($CTR_hwnd,$CTR_Text,$CTR_height,$CTR_font="Microsoft Sans Serif",$CTR_weight=1000) Local Const $ANSI_CHARSET = 0, $OUT_CHARACTER_PRECIS = 2, $CLIP_DEFAULT_PRECIS = 0, $PROOF_QUALITY = 2, $FIXED_PITCH = 1, $RGN_XOR = 3 If $CTR_font = "" Then $CTR_font = "Microsoft Sans Serif" If $CTR_weight = -1 Then $CTR_weight = 1000 Local Static $gdi_dll = DLLOpen("gdi32.dll") Local Static $CTR_hDC= DLLCall("user32.dll","int","GetDC","hwnd",$CTR_hwnd) Local Static $CTR_hMyFont = DLLCall($gdi_dll,"hwnd","CreateFont","int",$CTR_height,"int",0,"int",0,"int",0, _ "int",$CTR_weight,"int",0,"int",0,"int",0,"int",$ANSI_CHARSET,"int",$OUT_CHARACTER_PRECIS, _ "int",$CLIP_DEFAULT_PRECIS,"int",$PROOF_QUALITY,"int",$FIXED_PITCH,"str",$CTR_font ) Local Static $CTR_hOldFont = DLLCall($gdi_dll,"hwnd","SelectObject","int",$CTR_hDC[0],"hwnd",$CTR_hMyFont[0]) DLLCall($gdi_dll,"int","BeginPath","int",$CTR_hDC[0]) DLLCall($gdi_dll,"int","TextOut","int",$CTR_hDC[0],"int",0,"int",0,"str",$CTR_Text,"int",StringLen($CTR_Text)) DLLCall($gdi_dll,"int","EndPath","int",$CTR_hDC[0]) Local $CTR_hRgn1 = DLLCall($gdi_dll,"hwnd","PathToRegion","int",$CTR_hDC[0]) Local $CTR_rc = DLLStructCreate("int;int;int;int") DLLCall($gdi_dll,"int","GetRgnBox","hwnd",$CTR_hRgn1[0],"ptr",DllStructGetPtr($CTR_rc)) Local $CTR_hRgn2 = DLLCall($gdi_dll,"hwnd","CreateRectRgnIndirect","ptr",DllStructGetPtr($CTR_rc)) DLLCall($gdi_dll,"int","CombineRgn","hwnd",$CTR_hRgn2[0],"hwnd",$CTR_hRgn2[0],"hwnd",$CTR_hRgn1[0],"int",$RGN_XOR) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $CTR_hwnd, "long", $CTR_hRgn2[0], "int", 1) ;DLLCall($gdi_dll,"int","DeleteObject","hwnd",$CTR_hMyFont[0]) ; Memory leak <<<<<<<<<<<<<<<<<<<< DLLCall($gdi_dll,"int","DeleteObject","hwnd",$CTR_hRgn1[0]) ;DLLCall("user32.dll","int","ReleaseDC","hwnd",$CTR_hwnd,"int",$CTR_hDC[0]) ;DLLCall($gdi_dll,"int","SelectObject","int",$CTR_hDC[0],"hwnd",$CTR_hOldFont[0]) DLLCall($gdi_dll,"int","DeleteObject","hwnd",$CTR_hRgn2[0]) ; Memory leak <<<<<<<<<<<<<<<<<<<<<<< ;DLLClose($gdi_dll) #forceref $CTR_hOldFont EndFunc Func Action() ; Main program activity goes here EndFunc1 point
-
Swimlanes, Welcome to the AutoIt forum. I will leave the GDI gurus to look into your problem, but could I point you to my Notify or Toast UDFs (the links are in my sig below) either of which look to be something which would do exactly what you say you want: it might be quicker then trying to debug what you already have. And I would be happy to help you integrate either into your script. M231 point
-
Info Bar ( like tickertape)
obiwanceleri reacted to Melba23 for a topic
New and improved version can be found here Hi, This is a Marquee UDF I wrote some time ago. It has 3 functions: _GUICtrlMarquee_SetScroll : Sets movement parameters for Marquee _GUICtrlMarquee_SetDisplay : Sets display parameters for Marquee _GUICtrlMarquee_Create : Creates Marquee This is the UDF proper - save it as Marquee.au3: #include-once ; #INDEX# ======================================================================================================================= ; Title .........: Marquee ; Description ...: This module contains various Marquee functions ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ;_GUICtrlMarquee_SetScroll : Sets movement parameters for Marquee ;_GUICtrlMarquee_SetDisplay : Sets display parameters for Marquee ;_GUICtrlMarquee_Create : Creates Marquee ; =============================================================================================================================== ; #INTERNAL_USE_ONLY#============================================================================================================ ;================================================================================================================================ ; #INCLUDES# ==================================================================================================================== #include <WindowsConstants.au3> #include <WinAPI.au3> ; #GLOBAL VARIABLES# ============================================================================================================ Global $iMarquee_Loop = 0 Global $sMarquee_Move = "scroll" Global $sMarquee_Direction = "left" Global $iMarquee_Scroll = 6 Global $iMarquee_Delay = 85 Global $iMarquee_Border = 0 Global $vMarquee_TxtCol = Default Global $sMarquee_BkCol = Default Global $sMarquee_FontFamily = "Tahoma" Global $iMarquee_FontSize = 12 ; #FUNCTION# ==================================================================================================================== ; Name...........: _GUICtrlMarquee_SetScroll ; Description ...: Sets movement parameters for subsequent _GUICtrlCreateMarquee calls ; Syntax.........: _GUICtrlMarquee_SetScroll([$iLoop, [$sMove, [$sDirection, [$iScroll, [$iDelay]]]]]) ; Parameters ....: $iLoop - [optional] Number of loops to repeat. (Default = infinite) ; Use "slide" movement to keep text visible after stopping ; $sMove - [optional] Movement of text. From "scroll" (Default), "slide" and "alternate". ; $sDirection - [optional] Direction of scrolling. From "left" (Default), "right", "up" and "down". ; $iScroll - [optional] Distance of each advance - controls speed of scrolling (Default = 6) ; Higher numbers increase speed, lower numbers give smoother animation. ; $iDelay - [optional] Time in milliseconds between each advance (Default = 85). ; Higher numbers lower speed, lower numbers give smoother animation. ; Return values .: Success - Returns 0. ; Author ........: Melba 23, based on some original code by james3mg, trancexx and jscript "FROM BRAZIL" ; Related .......: _GUICtrlMarquee_Create, _GUICtrlMarquee_SetDisplay, ObjCreate ; Link ..........; ; Example .......; Yes ; =============================================================================================================================== Func _GUICtrlMarquee_SetScroll( $iLoop = 0, $sMove = 'scroll', $sDirection = 'left', $iScroll = 6, $iDelay = 85) ; Errorcheck and set parameters If IsNumber($iLoop) Then $iMarquee_Loop = Int(Abs($iLoop)) Switch $sMove Case 'alternate', 'slide' $sMarquee_Move = $sMove Case Else $sMarquee_Move = 'scroll' EndSwitch Switch $sDirection Case 'right', 'up', 'down' $sMarquee_Direction = $sDirection Case Else $sMarquee_Direction = 'left' EndSwitch If IsNumber($iScroll) Then $iMarquee_Scroll = Int(Abs($iScroll)) If IsNumber($iDelay) Then $iMarquee_Delay = Int(Abs($iDelay)) EndFunc ;=> _GUICtrlMarquee_SetScroll ; #FUNCTION# ==================================================================================================================== ; Name...........: _GUICtrlMarquee_SetDisplay ; Description ...: Sets display parameters for subsequent _GUICtrlCreateMarquee calls ; Syntax.........: _GUICtrlMarquee_SetDisplay([$iBorder, [$vTxtCol, [$vBkCol, [$iPoint, [$sFont]]]]) ; Parameters ....: $iBorder - [optional] 0 = None (Default), 1 = 1 pixel, 2 = 2 pixel, 3 = 3 pixel ; $vTxtCol - [optional] Colour for text (Default = system colour, -1 = unchanged) ; $vBkCol - [optional] Colour for Marquee (Default = system colour, -1 = unchanged) ; Colour can be passed as RGB value or as one of the following strings: ; 'black', 'gray', 'white', 'silver', 'maroon', 'red', 'purple', 'fuchsia', ; 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua' ; $iPoint - [optional] Font size (Default = 12, -1 = unchanged) ; $sFont - [optional] Font to use (Default = Tahoma, "" = unchanged) ; Return values .: Success - Returns 0. ; Author ........: Melba 23, based on some original code by james3mg, trancexx and jscript "FROM BRAZIL" ; Related .......: _GUICtrlMarquee_Create, _GUICtrlMarquee_SetScroll, ObjCreate ; Link ..........; ; Example .......; Yes ; =============================================================================================================================== Func _GUICtrlMarquee_SetDisplay($iBorder = Default, $vTxtCol = Default, $vBkCol = Default, $iPoint = Default, $sFont = Default) ; Errorcheck and set parameters Select Case $iBorder = Default $iMarquee_Border = 0 Case $iBorder >= 0 And $iBorder <= 3 $iMarquee_Border = Int(Abs($iBorder)) Case Else EndSelect Select Case $vTxtCol = Default $vMarquee_TxtCol = _WinAPI_GetSysColor($COLOR_WINDOWTEXT) Case IsNumber($vTxtCol) = 1 If $vTxtCol >= 0 And $vTxtCol <= 0xFFFFFF Then $vMarquee_TxtCol = Int($vTxtCol) Case Else $vMarquee_TxtCol = $vTxtCol EndSelect Select Case $vBkCol = Default $sMarquee_BkCol = _WinAPI_GetSysColor($COLOR_WINDOW) Case IsNumber($vBkCol) = 1 If $vBkCol >= 0 And $vBkCol <= 0xFFFFFF Then $sMarquee_BkCol = Int($vBkCol) Case Else $sMarquee_BkCol = $vBkCol EndSelect Select Case $iPoint = Default $iMarquee_FontSize = 12 Case $iPoint = -1 Case Else If IsNumber($iPoint) Then $iMarquee_FontSize = Int(Abs($iPoint / .75)) EndSelect Select Case $sFont = Default $sMarquee_FontFamily = "Tahoma" Case $sFont = "" Case Else If IsString($sFont) Then $sMarquee_FontFamily = $sFont EndSelect EndFunc ;=> _GUICtrlMarquee_SetDisplay ; #FUNCTION# ==================================================================================================================== ; Name...........: _GUICtrlMarquee_Create ; Description ...: Creates a marquee Label control for the GUI ; Syntax.........: _GUICtrlMarquee_Create( $sText, $iLeft, $iTop, $iWidth, $iHeight, [$sTipText]) ; Parameters ....: $sText - The text (or HTML markup) the marquee should display. ; $iLeft - The Left side of the control. If -1 is used then left will be computed according to GUICoordMode. ; $iTop - The Top of the control. If -1 is used then left will be computed according to GUICoordMode. ; $iWidth - The width of the control. ; $iHeight - The height of the control. ; $sTipTxt - [optional] Tip text displayed when mouse hovers over the control. ; Return values .: Success - Returns the identifier (controlID) of the new Marquee control. ; Failure - Returns 0 ; Author ........: james3mg, trancexx and jscript "FROM BRAZIL" ; Modified.......: Melba23 ; Remarks .......: This function attempts to embed an 'ActiveX Control' or a 'Document Object' inside the GUI. ; The GUI functions GUICtrlRead and GUICtrlSet have no effect on this control. The object can only be ; controlled using 'methods' or 'properties' on the $ObjectVar. ; Related .......: _GUICtrlMarquee_SetDisplay, _GUICtrlMarquee_SetScroll, ObjCreate ; Link ..........; ; Example .......; Yes ; =============================================================================================================================== Func _GUICtrlMarquee_Create($sText, $iLeft, $iTop, $iWidth, $iHeight, $sTipText = "") ; Declar Local variables Local $oShell, $iCtrlID $oShell = ObjCreate("Shell.Explorer.2") If Not IsObj($oShell) Then Return SetError(1, 0, -1) $iCtrlID = GUICtrlCreateObj($oShell, $iLeft, $iTop, $iWidth, $iHeight) $oShell.navigate("about:blank") While $oShell.busy Sleep(100) WEnd With $oShell.document .write('<style>marquee{cursor: default}></style>') .write('<body onselectstart="return false" oncontextmenu="return false" onclick="return false" ondragstart="return false" ondragover="return false">') .writeln('<marquee width=100% height=100%') .writeln("loop=" & $iMarquee_Loop) .writeln("behavior=" & $sMarquee_Move) .writeln("direction=" & $sMarquee_Direction) .writeln("scrollamount=" & $iMarquee_Scroll) .writeln("scrolldelay=" & $iMarquee_Delay) .write(">") .write($sText) .body.title = $sTipText .body.topmargin = 0 .body.leftmargin = 0 .body.scroll = "no" .body.style.color = $vMarquee_TxtCol .body.bgcolor = $sMarquee_BkCol .body.style.borderWidth = $iMarquee_Border .body.style.fontFamily = $sMarquee_FontFamily .body.style.fontSize = $iMarquee_FontSize EndWith Return $iCtrlID EndFunc ;=> _GUICtrlMarquee_CreateAnd this is an example script to show it working: #include <Marquee.au3> GUICreate("Marquee Example", 320, 220) _GUICtrlMarquee_Create("Default Marquee Parameters", 10, 10, 300, 20) _GUICtrlMarquee_SetScroll(Default, "alternate", "right", 7, Default) _GUICtrlMarquee_SetDisplay(1, 0xFF0000, 0xFFFF00, 12, "times new roman") _GUICtrlMarquee_Create("Back And Forth", 10, 45, 300, 20) _GUICtrlMarquee_SetScroll(0, Default, "up", 1) _GUICtrlMarquee_SetDisplay(2, "green", Default, 18, "comic sans ms") _GUICtrlMarquee_Create("Up and Up...", 10, 80, 150, 30, "Vertical Scroll Up") _GUICtrlMarquee_SetScroll(0, Default, "down", 1) _GUICtrlMarquee_SetDisplay(2, "fuchsia", -1, "", -1) _GUICtrlMarquee_Create("Down We Go", 160, 80, 150, 30, "Vertical Scroll Down") _GUICtrlMarquee_SetScroll(0, Default, "right", Default, 120) _GUICtrlMarquee_SetDisplay(3, "red", "silver", 12, "arial") _GUICtrlMarquee_Create("And slowly to the right", 10, 120, 300, 26) _GUICtrlMarquee_SetScroll(-1, "slide", Default, 2) _GUICtrlMarquee_SetDisplay(1, "blue", "cyan", 9, "courier new") _GUICtrlMarquee_Create(" Just the once", 10, 160, 300, 17) _GUICtrlMarquee_SetScroll() _GUICtrlMarquee_SetDisplay() _GUICtrlMarquee_Create("Default Marquee Parameters", 10, 190, 300, 20, "Everything at default") GUISetState() While 1 If GUIGetMsg() = -3 Then Exit WEndI hope you find it useful. M231 point