All Activity
- Today
-
donnyh13 reacted to a post in a topic: Uploaded a new version of the SciTE4AutoIt3.exe v21.316.1639.1
-
donnyh13 reacted to a post in a topic: Uploaded a new version of the SciTE4AutoIt3.exe v21.316.1639.1
-
ioa747 reacted to a post in a topic: GDI+ and Taskbar Overlay Icon
-
GDI+ and Taskbar Overlay Icon
seadoggie01 replied to seadoggie01's topic in AutoIt General Help and Support
This worked great, thank you! I kept getting lost in a couple of bugs and forgot to respond. One weird thing I discovered is that Outlook likes to clear the icon especially if a message is marked as read or unread, so my testing was very unreliable. Here's my semi-final script that includes getting the unread count from Outlook and managing the icon: #include <GDIPlus.au3> #include <WinAPIIcons.au3> #include <OutlookEX.au3> #include <TrayConstants.au3> #include <Taskbar.au3> ; This is just the Taskbar stuff reorganized into a UDF AutoItSetOption("TrayIconHide", 1) AutoItSetOption("TrayMenuMode", 1 + 2) ; Global Constants Global Const $__g_iWIDTH = 128, $__g_iHEIGHT = 128, $__g_iBACKGROUND_COLOR = 0xFFFF0000 Global Const $__g_iFONT_SIZE = 56, $__g_sFAMILY = "Arial", $__g_iFONT_COLOR = 0xFFFFFFFF Global Const $__g_iBORDER_WIDTH = 6, $__g_iBORDER_COLOR = 0xFF000000 Global Const $__g_iEMAIL_DELAY_SECONDS = 5 ; Global GDIPlus _GDIPlus_Startup() Global $__g_hFormat = _GDIPlus_StringFormatCreate() Global $__g_hFamily = _GDIPlus_FontFamilyCreate($__g_sFAMILY) Global $__g_hFont = _GDIPlus_FontCreate($__g_hFamily, $__g_iFONT_SIZE) Global $__g_hTextBrush = _GDIPlus_BrushCreateSolid($__g_iFONT_COLOR) Global $__g_hBackgroundBrush = _GDIPlus_BrushCreateSolid($__g_iBACKGROUND_COLOR) Global $__g_hBorderPen = _GDIPlus_PenCreate($__g_iBORDER_COLOR, $__g_iBORDER_WIDTH) Main() Cleanup() Func Main() Local $hOutlook = WinGetHandle("[REGEXPTITLE:(.*Outlook); CLASS:rctrl_renwnd32]") TrayCreateItem("Email Overlay Icon") TrayItemSetState(-1, $TRAY_DISABLE) Local $idExit = TrayCreateItem("Exit") TraySetState() TraySetToolTip("Email Overlay Icon") Local $oTB = _Taskbar_Init() Local $hTimer = TimerInit() Local $iCurrentEmails = 0, $iNewEmails = 0 Local $oOutlook = _OL_Open() Local $aFolder = _OL_FolderAccess($oOutlook, Default, $olFolderInbox) Local $oFolder = $aFolder[1] Local $hCurrentIcon = Null While True If TimerDiff($hTimer) > ($__g_iEMAIL_DELAY_SECONDS * 1000) Then $iNewEmails = GetUnreadEmails($oOutlook, $oFolder) If $iNewEmails > 99 Then $iNewEmails = 99 ; If the counts differ and there are now no emails If ($iCurrentEmails <> $iNewEmails) And ($iNewEmails = 0) Then ; remove the overlay icon _Taskbar_SetOverlayIcon($oTB, $hOutlook, Null, "") $hCurrentIcon = Null ; Else if the counts differ ElseIf $iCurrentEmails <> $iNewEmails Then _WinAPI_DestroyIcon($hCurrentIcon) $hCurrentIcon = UpdateOverlayIcon($oTB, $hOutlook, $iNewEmails) Else ; Outlook likes to remove the icon sometimes so keep resetting it _Taskbar_SetOverlayIcon($oTB, $hOutlook, $hCurrentIcon) EndIf ; Update the current count $iCurrentEmails = $iNewEmails ; Reset the timer $hTimer = TimerInit() EndIf ; Do tray stuff If TrayGetMsg() = $idExit Then ExitLoop WEnd _WinAPI_DestroyIcon($hCurrentIcon) _Taskbar_SetOverlayIcon($oTB, $hOutlook, Null, "") _GDIPlus_Shutdown() TraySetState($TRAY_ICONSTATE_HIDE) EndFunc Func UpdateOverlayIcon($oTB, $hWnd, $sText) If Not WinExists($hWnd) Then Exit Debug("Outlook is closed now?") Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($__g_iWIDTH, $__g_iHEIGHT, $GDIP_PXF32ARGB) ; If ErrMsg(_GDIPlus_BitmapCreateFromScan0) Then Exit Local $hGraphicBitmap = _GDIPlus_ImageGetGraphicsContext($hBitmap) ; If ErrMsg(_GDIPlus_ImageGetGraphicsContext) Then Exit _GDIPlus_GraphicsSetSmoothingMode($hGraphicBitmap, 2) _GDIPlus_GraphicsClear($hGraphicBitmap, 0x00000000) _GDIPlus_GraphicsFillEllipse($hGraphicBitmap, 0, 0, $__g_iWIDTH - 2, $__g_iHEIGHT - 2, $__g_hBackgroundBrush) _GDIPlus_GraphicsDrawEllipse($hGraphicBitmap, 0, 0, $__g_iWIDTH - 2, $__g_iHEIGHT - 2, $__g_hBorderPen) Local $tLayout = _GDIPlus_RectFCreate(2, 2, $__g_iWIDTH - 4, $__g_iHEIGHT - 8) DrawStringCentered($hGraphicBitmap, $sText, $tLayout) Local $hIcon = _GDIPlus_HICONCreateFromBitmap($hBitmap) _Taskbar_SetOverlayIcon($oTB, $hWnd, $hIcon, $sText) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hGraphicBitmap) Return $hIcon EndFunc Func DrawStringCentered($hGraphic, $sText, $tLayout) ; Calculate Local $aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $sText, $__g_hFont, $tLayout, $__g_hFormat) ; If ErrMsg(_GDIPlus_GraphicsMeasureString) Then Exit Local $tIndex = $aInfo[0] $tIndex.X = $tLayout.X + (($tLayout.Width - $tIndex.Width) / 2) $tIndex.Y = $tLayout.Y + (($tLayout.Height - _GDIPlus_FontGetHeight($__g_hFont, $hGraphic)) / 2) ; Draw _GDIPlus_GraphicsDrawStringEx($hGraphic, $sText, $__g_hFont, $tIndex, $__g_hFormat, $__g_hTextBrush) EndFunc Func GetUnreadEmails($oOL, $oFolder) Local $iNewMail = _OL_FolderGet($oOL, $oFolder) ; If ErrMsg(_OL_FolderGet) Then Return -1 $iNewMail = $iNewMail[7] ;= unread count Return $iNewMail EndFunc Func Cleanup() _GDIPlus_PenDispose($__g_hBorderPen) _GDIPlus_BrushDispose($__g_hBackgroundBrush) _GDIPlus_BrushDispose($__g_hTextBrush) _GDIPlus_FontDispose($__g_hFont) _GDIPlus_FontFamilyDispose($__g_hFamily) _GDIPlus_StringFormatDispose($__g_hFormat) _GDIPlus_Shutdown() EndFunc I found that making the graphic larger made the text more readable. Anything beyond 64x64 looked the same to me, so I left it alone at 128. It still needs error handling (especially to check if Outlook is closed), but I'll add that later. Probably. -
KaFu reacted to a post in a topic: Uploaded a new version of the SciTE4AutoIt3.exe v21.316.1639.1
-
Hello, welcome to the forum. Pls. let me point out, that the term "UDF" wasn't used correctly by ChatGPT: UDF = User Defined Funktions = non standard functions, helping people like water wrote and shared to the autoit community: Open the "my UDFs and Tutorials" in the posting of Water above, then you will see, what I mean. Use this URL to find many, many UDFs at this web site: https://www.autoitscript.com/forum/forum/9-autoit-example-scripts/ What ChatGPT should have advised is, that you need to *INCLUDE* the mentioned AU3 files to your code. The included additional functions are defined in the AU3 files in this folder: C:\Program Files (x86)\AutoIt3\Include in your SCITE Editor start typing "incl" > it will turn red > tab > it will change like this, just start typing the name of the include you need: Rudi.
-
ioa747 reacted to a post in a topic: Uploaded a new version of the SciTE4AutoIt3.exe v21.316.1639.1
-
Uploaded a new version of the SciTE4AutoIt3.exe v21.316.1639.1
Dan_555 replied to Jos's topic in AutoIt Technical Discussion
One way to launch other tools while a compiled program is running would be to use a tool like this: Scite Plusbar -
KaFu reacted to a post in a topic: Uploaded a new version of the SciTE4AutoIt3.exe v21.316.1639.1
-
Uploaded a new version of the SciTE4AutoIt3.exe v21.316.1639.1
Jos replied to Jos's topic in AutoIt Technical Discussion
Understand the request, but this is how the internals work in SciTE to be able to capture the output generated by the Script. These are things I won't be trying to change unless it is changed in the Core version supported by Neil. -
tasoxfclo joined the community
- Yesterday
-
Uploaded a new version of the SciTE4AutoIt3.exe v21.316.1639.1
KaFu replied to Jos's topic in AutoIt Technical Discussion
Hi Jos, a feature request for SciTE from my side. When I run code in SciTE, all entries under "Tools" except the last 5 are greyed out. Would it be possible to leave those enabled, which do not interfere with the current code execution? Especially for running "AU3Info" I don't know how many times I had to abort the current execution, start AU3Info and then run the code again 🙂, because I forgot to start AU3Info early. Maybe it makes sense to leave some others enabled too, e.g. Open Explorer in Scriptdir, Codewizard and Koda? Best Regards -
Quick test after download 5 min ago : new version (x86) works fine for showing progress in Console & aborting (Esc) during progress, in Example 9. Well done !
-
Yes, I forgot to removed these lines for the other functions but I need to add the code also for the other function with callbacks. Currently only function "WebP_CreateWebPCreateAnimFromScreenCapture" in the dll is implemented (example 9) for callback but it should be easy to add also for the other functions. I think tomorrow I will add it to the other functions, too.
-
Great news as progress callback didn't show at all in the console (dll x86) even after I replaced at 3 different places in WebP.au3 "ptr", @AutoItX64 ? $pCallback : 0)[0] with "ptr", $pCallback)[0] If not mistaken, all Console output lines come from the script (WebP Example9.au3) except this line displayed in Console by the dll : Starting...done! I'm gonna check your download site for the updated version including progress. No need to hurry, just take all the time you need to have it work nicely. Thanks a lot for this great script
-
Thx for testing. Figured out how callback can be used with Example9 to show progress and abort capturing...
-
Yes it is working. The 10s output file "Captured.webp" displays in the GUI, then loops until we close the GUI. It displays same in IrfanView.
-
I tried again using a Stdout script along with the small command line version of DebugView++. Ran my test script while VLC Player was running, no problems/hangs/crashes encountered. Ran my test script while PowerDVD was running and again no problems encountered. Here is my test script: #include <AutoItConstants.au3> HotKeySet("{Esc}", "Terminate") Local $CMD = 'DebugViewConsole-small.exe -a -c -f -i "deviceModeChangedCallbackEvent:" -i "json_event[{"isEnabled":true}]" -i "json_event[{"isEnabled":false}]"' Local $PID = Run('"' & @ComSpec & '" /k ' & $CMD, "", @SW_HIDE, $STDOUT_CHILD); Local $strData Local $strEvent = 'deviceModeChangedCallbackEvent:' ; Windows debug message/event to wait for. Local $strKeyDn = 'json_event[{"isEnabled":true}]' ; 'Fn' key down on Razer keyboard. Local $strKeyUp = 'json_event[{"isEnabled":false}]' ; 'Fn' key up on Razer keyboard. While ProcessExists($PID) $strData = StdoutRead($PID) If StringInStr($strData, $strEvent) Then If StringInStr($strData, $strKeyDn) Then MsgBox(0, "Event", "Fn key down") If StringInStr($strData, $strKeyUp) Then MsgBox(0, "Event", "Fn key up") EndIf sleep(10) WEnd Func Terminate() Run('"' & @ComSpec & '" /k ' & 'DebugViewConsole-small -x', "", @SW_HIDE) ; Kill all DebugView++ instances. Exit EndFunc As far as I can tell, after a couple of hours testing, everything is works without any problems. It is a pity that I had to use a third-party app though. Oh well.
-
@pixelsearch thanks for testing. Is Example9 working? Currently I'm trying to figure out how the callback is working but no real examples.
-
Hello @UEZ Just downloaded all your files (including the Frames subfolder containing 10 png files to create the animation). Somes files were updated 3 hours ago, lucky me to download the brand new release just now Example 8 worked fine and the created animation "TestAnim.webp" displayed without any issue. Well done
-
How to pin a script to the taskbar or start menu
argumentum replied to argumentum's topic in AutoIt Example Scripts
Added a new version. It now looks for the environment variable %AUTOIT3DIR% and if it exists, the link will have that instead of the hard path. That way you can test a beta or another version easily. To set the %AUTOIT3DIR%, you can run from a command prompt setx AUTOIT3DIR C:\PathTo\AutoIt3 and that'd set it for you. -
Which version of Autoit do you run? WinAPISys.au3, WinAPIProc.au3 and WinAPIHObj.au3 exist in folder C:\Program Files (x86)\AutoIt3\Include of version 3.3.16.1 I'm running
-
Can you provide us with some code? We would like to see the unimplemented functions in your code. Thank you.
-
I am developing a window managing tool and I use ChatGPT to support this. It has provided some functions for window moving and resizing. It suggested to use the following UDFs: WinAPIMon.au3 – 13.081 Byte WinAPISys.au3 – 77.594 Byte WinAPIProc.au3 – 76.629 Byte WinAPIHObj.au3 – 16.852 Byte These are not in the scope of my installation. Is this a problem of my new installation I performed the last days or are these UDFs which are only available by the forum. I did some searches but I was not able to succeed. Can you give some hints where or how to seek?
-
HelmutJ joined the community
-
Update! While the debug capture script definitely works, it causes problems with any other running software that use windows debug messages. Took a while to notice this problem. Here’s my example: I was running PowerDVD, just listening to a DVD box set while I was testing my debug capture script. I noticed that PowerDVD would hang/crash if the script was running. It was not obvious to begin with, PowerDVD can throw a tantrum if DVD needs a clean, so I didn’t see the connection to my script up straight away. PowerDVD uses debug messages under normal operation and the script was interfering. Also affects VLC player, any (all?) Stardock software, and I assume a lot more software packages that make use of windows debug messages. I have (re-)tested using the DebugCapture.dll: https://www.autoitscript.com/forum/topic/82889-capture-debug-information-udf/ and Argumentum’s solution in this thread. Both result in the same lockup/crash problem. For what I am trying to achieve I need the script to be constantly running. If the script causes problems with software then using debug scripts are obviously not the solution, for me anyway. As said, the DebugCapture.dll and Argumentum’s script works perfectly well on their own. Hopefully this post will save others some problems trying something similar to what I was hoping to do. Sysinternals Debugview and DebugView++ do not cause software to hang or crash. So it is possible. Both can be run using the command line. Originally, I tried Stdout scripts on both but was sketchy, though that was probably my scripting! I might have another look into this, or… I may have another cunning plan/solution. I can capture the USB data of my keyboard using Wireshark & USBPcap. If I can monitor the USB data somehow, then maybe I can find a good alternative to using windows debug messages.
-
How to pin a script to the taskbar or start menu
argumentum posted a topic in AutoIt Example Scripts
vs. If you would like to pin the script to the taskbar ( or the start menu ), it can be done with a link. This script is an example and demonstration. The way that I go about it, is to have the script and icon with the same name. The easiest way to test this is if the post had it all in a ZIP file so, there: Example AutoIt v3 Script_v2.zip Also, it's easier to find in task manager given that you can see your icon. - Last week
-
ByRH changed their profile photo
-
Embedding font in compiled binary and loading per-session
UEZ replied to WildByDesign's topic in AutoIt GUI Help and Support
Here you should find one way how to embed your font (Display Font from Memory): -
I am trying to embed a font file in my compiled binary with the following: #AutoIt3Wrapper_Res_File_Add=embed\Aptos-Mono.ttf, rt_rcdata, aptos_ttf And trying to load it temporarily (per-session) with various iterations of the following: _WinAPI_AddFontResourceEx(@ScriptFullPath & ", aptos_ttf", $FR_PRIVATE) But I can't seem to get that to work and I've tried a few different things with the _WinAPI_AddFontResourceEx line. I know that I could FileInstall and load it easy that way, but I would prefer to load it directly from the compiled binary resources if possible. Thank you for any help or ideas with this.
-
I've updated GImageX with the latest version of the ADK. (Dec 2024 version). Don't think the ADK version was the OP's issue. But updated it anyway.
-
Microsoft insists that the false positive is removed from the compiled binary and is no longer detected by Windows Defender. VirusTotal shows it. But apparently Windows Defender itself does not detect it and we're good to go. First post has been updated with version 1.0.3. This version is mostly a bug-fix release with a fix for Windows Terminal losing border color after being minimized. And a regression where border colors, if not set in custom rules, were not properly falling back to the global set value. That was a weird bug that took me forever to understand how/why it was happening but finally fixed it. I also made some changes that made the overall performance even better. Several functions were made to be more efficient. Less loops. I also made a special function Func _ColorBorderOnly($hWnd, $sClassName, $sName) to handle the border coloring in the Foreground Case only. Prior to that, the border stuff was going through the main coloring function and therefore a lot of extra stuff that was not necessary in the Foreground Case. So this also made things much more efficient.
-
I have a really nice update lined up to release that increases performance a bit more and fixed the last few remaining bugs. However, after Microsoft removed the previous false positive, it is back. They are calling it: Trojan:Win32/Wacatac.B!ml That seems to be their generic "everything is a virus" name. So curious, I decided to gut my entire script leaving only a While loop and the includes. My hope was to nail down exactly which function or include could be triggering the detection. Still detected. So I removed the includes one at a time and testing on VirusTotal each time. So I end up only with a While loop, no includes. Nothing else. Microsoft still detects the bare bones binary as: Trojan:Win32/Wacatac.B!ml I also tried all various compression levels and no luck still. If there is nothing in there but a While loop, what else can they detect? What part of AutoIt is in there as interpreter? (like, what binary?) I scanned all of the actual AutoIt binaries and none of them get detected by Microsoft.