Jump to content

seadoggie01

Active Members
  • Posts

    928
  • Joined

  • Last visited

  • Days Won

    6

Reputation Activity

  1. Like
    seadoggie01 reacted to genius257 in Another AutoIt extension for Visual Studio Code   
    It was semi-manually, since i also needed to add parameter types and return types. 😅
    semi, because i used my inline suggestions from my windsurf AI vscode extension to speed things up.
    That might be why the text is wrong at some places 
     
    Edit:
    I've updated the summary for the two functions mentioned. It will be available with next version 😉
  2. Thanks
    seadoggie01 got a reaction from genius257 in Another AutoIt extension for Visual Studio Code   
    In native.au3 when documenting ControlGetHandle on line 1680 it says, "Returns the control's current text.", but it should be "Retrieves the internal handle of a control." Similarly, ControlGetFocus has the incorrect description text as well.
    It doesn't bother me, but if you auto-document there may be a bug? If you copy/pasted, then I'm sorry; that's a lot of work!
  3. Like
    seadoggie01 got a reaction from argumentum in Another AutoIt extension for Visual Studio Code   
    In native.au3 when documenting ControlGetHandle on line 1680 it says, "Returns the control's current text.", but it should be "Retrieves the internal handle of a control." Similarly, ControlGetFocus has the incorrect description text as well.
    It doesn't bother me, but if you auto-document there may be a bug? If you copy/pasted, then I'm sorry; that's a lot of work!
  4. Like
    seadoggie01 got a reaction from genius257 in Another AutoIt extension for Visual Studio Code   
    Would it instead be possible to have some sort of state such that you enable or disable the possibility of having ".Property" as valid? It seems like nested rules would be much more difficult/annoying to implement. Then again, I know very little of parsers having only ever made ~1/2 to 3/4 of one myself
    After skimming your parser:  I might look up PegJS later tonight, but I don't think that my idea will work there.
    This. Is. Fantastic!
    1.8.5 does fix my issue, thank you!
  5. Like
    seadoggie01 got a reaction from SOLVE-SMART in Another AutoIt extension for Visual Studio Code   
    Would it instead be possible to have some sort of state such that you enable or disable the possibility of having ".Property" as valid? It seems like nested rules would be much more difficult/annoying to implement. Then again, I know very little of parsers having only ever made ~1/2 to 3/4 of one myself
    After skimming your parser:  I might look up PegJS later tonight, but I don't think that my idea will work there.
    This. Is. Fantastic!
    1.8.5 does fix my issue, thank you!
  6. Thanks
    seadoggie01 reacted to genius257 in Another AutoIt extension for Visual Studio Code   
    Hi @seadoggie01!
    Thanks for the heads up!
    This is due to the incomplete parser. Currently With...EndWith blocks are not supported. Anything inside the block will fail, since i haven't added any rules to it yet. The reason is that EVERY rule needs to be copied with the small change, that ".property" is a valid syntax within that or child code blocks.
    It is low priority, since With...EndWith is rarely seen used, but will be supported in the future at some point (depending on how urgent it is).
    That's an interesting bug! From quick testing, the issue seems to be caused by the empty line in the remarks:
    ; Remarks .......: Use like: _Acro_DocBookmarkProperties($oBookmark) to get an array of values ; ; Default means values won't be changed. My guess is some of my code is stuck in an infinite loop... I will look into it and fix it soon, since it can deadlock the extension.
    "Legacy" documentation blocks was implemented quick, since I'm trying to move towards the more cross language familiar docBlock syntax, but that still does not mean the code should fail this spectacularly😅
     
    >Developer: Reload Window
    Should be your solution. It's not great, but faster than restarting the entire application 😉
     
    Thank you for the kind words and the bug reporting! 😄
     
    Edit:
    found the line causing problems with the function documentation: https://github.com/genius257/vscode-autoit/blob/0f1bb89f8af77ee7a005d1d5a9da429e5f344700/server/src/autoit/docBlock/DocBlockFactory.ts#L84
    It's my regular expression to test if the content matches the UDF documentation format. It causes catastrophic backtracking, never getting past that regex check. Prevention in JS seems to time a new worker, child-process or a regex library, from a quick google search...
    I don't want to do any of that currently, so I've updated the regex, so it no longer has issues with your example, and if my test parses, I will push the change, and hope this issue does not come back 😜
  7. Like
    seadoggie01 reacted to genius257 in Another AutoIt extension for Visual Studio Code   
    1.8.5 released!
    This contains fix for the issue caused by UDF documentation headers with an empty newline in their content, found by @seadoggie01
    I also found and fixed a related issue, where the capture regex did not capture the text after the empty newline for the tool-tip content.
  8. Thanks
    seadoggie01 got a reaction from genius257 in Another AutoIt extension for Visual Studio Code   
    I think I have two bugs to report. I'm currently using VS Code 1.101.0 and v1.8.4 of your extension.
    The extension gives an error about the With syntax found in Excel.au3 in _Excel_BookNew. The error is: Syntax error: Expected "_", [\t ], or end of line but "I" found. The extension will silently stop displaying suggestions and won't load any function documentation if you reference a file that contains function documentation that is incorrectly formatted. In my case, I was referencing my Acro.au3 file which has a split Syntax line and an empty remarks line. It requires both to stop functioning, but I haven't been able to figure out exactly what the conditions are. It looks like this: I don't always follow the "proper" documentation (due to laziness about learning it), but I don't think the extension should crash because of it  It'd be fantastic if it reported an error, great if it displayed just the information it understood, and perfectly acceptable if it displayed nothing and waited for me to update the documentation to something valid (hahahahaha!)
    Also, if anyone knows how to quickly restart extensions, I'd love to know. I spent a while testing by deleting some code, closing, and then reopening VS Code to find this bug. The "Extensions: Refresh" does nothing in the case of this not-quite-an-error. Disabling and enabling the extension via the menu is slow, but works -- as I found out later.
    As always, thank you so much for your work on this extension!
  9. Like
    seadoggie01 reacted to genius257 in Another AutoIt extension for Visual Studio Code   
    Working towards the 1.9.0 release was taking too long, so I'm releasing 1.8.4 in the meantime
    Notable changes:
    ignoreInternalInIncludes setting would also ignore declarations in current file. Fixed so only internal declarations in included files are ignored. When resolving included files, the same file could be loaded from disk multiple times. This will improve performance, when opening au3 files.
  10. Like
    seadoggie01 got a reaction from SOLVE-SMART in Another AutoIt extension for Visual Studio Code   
    I think I have two bugs to report. I'm currently using VS Code 1.101.0 and v1.8.4 of your extension.
    The extension gives an error about the With syntax found in Excel.au3 in _Excel_BookNew. The error is: Syntax error: Expected "_", [\t ], or end of line but "I" found. The extension will silently stop displaying suggestions and won't load any function documentation if you reference a file that contains function documentation that is incorrectly formatted. In my case, I was referencing my Acro.au3 file which has a split Syntax line and an empty remarks line. It requires both to stop functioning, but I haven't been able to figure out exactly what the conditions are. It looks like this: I don't always follow the "proper" documentation (due to laziness about learning it), but I don't think the extension should crash because of it  It'd be fantastic if it reported an error, great if it displayed just the information it understood, and perfectly acceptable if it displayed nothing and waited for me to update the documentation to something valid (hahahahaha!)
    Also, if anyone knows how to quickly restart extensions, I'd love to know. I spent a while testing by deleting some code, closing, and then reopening VS Code to find this bug. The "Extensions: Refresh" does nothing in the case of this not-quite-an-error. Disabling and enabling the extension via the menu is slow, but works -- as I found out later.
    As always, thank you so much for your work on this extension!
  11. Like
    seadoggie01 got a reaction from genius257 in Another AutoIt extension for Visual Studio Code   
    I quite like the addition of the syntax highlighting to the UDF headers. It looks a bit strange right now since it's new, but it makes them much more readable. I haven't noticed any speed or performance issues, so (as my grandma says) it's good enough for who it's for
    With the addition of UDF comment support, what do you think about collapsing those definitions? They usually start with a single semi-colon and don't collapse as they're a series of single line comments, but IMHO they should collapse. I like documenting my own functions, but I like a script that quickly collapses even more as it helps with finding functions. If you want collapsing with the standard UDF headers, you might consider accepting a leading space before the comment. Currently, any space will cancel the syntax highlighting.
    That said, I may have solved my own problem. Since you've added your own format of UDF documentation, I may start using it if you plan to keep it around. I decided to hack extend it a bit and include my error values there as well. By adding a space before the start of each line you can control the comment collapsing as well. I came up with this snippet to add a UDF documentation header (I added it to %AppData%\Code\User\snippets\au3.json)
    "A UDF in Genius' format": { "prefix": ["udfNew"], "body": [ "#cs ${1:Function Description}", " # @param ${2:Parameter Type} $${3:Parameter Name} ${4:Parameter Description}", " # @return ${5:Return on Success}", " # @return-Failure ${6:Return on failure}", " # @error-1 ${7:Possible error values}", " #ce" ] } When it collapses, it leaves the function description outside of the collapsed region and hides the #ce because it's "indented" too.
  12. Thanks
    seadoggie01 reacted to genius257 in Another AutoIt extension for Visual Studio Code   
    Version 1.8.2 has just been released!
    I should have been 1.8.0, but issues with deployment pipeline after bigger changes to how the parser code and types are generated (internally) meant that i had to increment patch version 2 times, to successfully be able to release to the extension marketplaces.
    Notable changes:
    Added au3 DocBlock `@link` tag support Added syntax highlighting for au3 DocBlock and legacy UDF headers 2 things i would like feedback on, if possible:
    About the new syntax highlighting: Let me know if and/or how you like or dislike it. Performance: small changes to how the parser worked with some parser rules, to better generate types. Smaller tests indicated it was same or faster, but it can very much depend how it traverses through the code. Let me know if you notice any slow down, so I can look into fixing it ASAP! Feedback can be here, via an issue or via the discussion for the release.
  13. Like
    seadoggie01 got a reaction from SOLVE-SMART in Verify Username and Email Address   
    My final code looks something like this:
    Get-MgUser -Filter "UserPrincipalName eq '<UserName>@<DN>.net'" -Property "proxyAddresses" | Select-Object -ExpandProperty ProxyAddresses This returns a list of (mostly) email addresses. The one prefixed with a capitalized SMTP is the primary email and others with lowercased smtp are proxy emails. My results have other protocols that I'll ignore (prefixed with things other than SMTP).
    The proxyAddresses and other user properties are documented here: user resource type - Microsoft Graph v1.0 | Microsoft Learn
    Thank you Solve-Smart and Subz for pointing me in the right direction!
  14. Thanks
    seadoggie01 reacted to Subz in Verify Username and Email Address   
    You should use UPN (User Principal Name), as Azure/Entra doesn't recognise samAccountName attribute.  if using Get-Mailbox you can request PrimarySmtpAddress or as mentioned use Get-MgUser -UserId 'UPN' | Select-Object DisplayName, Mail which should also show the PrimarySmtpAddress.
  15. Thanks
    seadoggie01 reacted to SOLVE-SMART in Verify Username and Email Address   
    Hi @seadoggie01 👋 ,
    does your company uses MS 365? In case yes, you could use the Microsoft Graph API to combine Exchange and AD.
    A quick research puts out such Powershell code snippet/commandlet.
    $headers = @{ Authorization = "Bearer $accessToken" } Invoke-RestMethod -Uri "https://graph.microsoft.com/v1.0/users?$filter=mail eq '[email protected]'" -Headers $headers Another way could be using LDAP (if set up and access is granted). Something like:
    $ldap = [ADSI]"LDAP://your.domain.com" $searcher = New-Object DirectoryServices.DirectorySearcher($ldap) $searcher.Filter = "(&(objectClass=user)([email protected]))" $result = $searcher.FindOne() if ($result) { "User found" } else { "Not found" } ⚠ These are just ideas, not fully developed solutions.
    Best regards
    Sven
  16. Like
    seadoggie01 got a reaction from SOLVE-SMART in Verify Username and Email Address   
    We do have MS 365 and Graph API is exactly what I was looking for, it seems. I found Get-MgUser (Microsoft.Graph.Users) | Microsoft Learn from a few searches and that's working in PowerShell. (This also lead me in to a weird rabbit hole of exploring MS Entra and possibly solving an unrelated problem.) I'll post back here when I have something that's a more complete answer to this.
  17. Like
    seadoggie01 reacted to Jos in Visual Studio Code Extension currently available and future plans for SciTE?   
    Let's not make this topic more difficult than it is and stick for now to VSCode/SciTE. One can always decide to go down an alternative path later when VSCode is working.  
  18. Like
    seadoggie01 reacted to SOLVE-SMART in Visual Studio Code Extension currently available and future plans for SciTE?   
    Many thanks to everyone, especially to @genius257 for your well written assessment and your explanation 👌 .
    A few pros and cons were already mentioned which is great.
    I really looking forward to @LoganCHs opinion and to his statements about his VSCode extension (origin by Damien, "damien.autoit").
    I believe he is pretty busy and maybe cannot work on the extension much more. At least that's my impression over the last few months or maybe even the last two years. The GitHub "issue" area is relatively full and only a few of the requests were processed promptly. 💡 Important: This is really not meant to be a criticism, as I really enjoy working with VSCode with the extension, it's just an statement. Hence the question of how he sees the future in this regard or if he would like support with further development.
    Best regards
    Sven
  19. Like
    seadoggie01 got a reaction from SOLVE-SMART in Visual Studio Code Extension currently available and future plans for SciTE?   
    While I've been moving away from using AutoIt lately, I started using Visual Studio Extensions about a year ago. I started with Damien/LoganCH's extension because it was the only available option at the time (I think). That said, there were a few issues (I think mostly Code Folding issue #89 - that's still open) with it at the time that caused me to start using genius's extension as soon as it came out. It was slightly choppy at the start, but considering my reduced usage of AutoIt, it's been fairly smooth sailing. Lately, I can't find a single issue with it despite it being "less mature"  But I also use AutoIt for fairly simple things now like making a GUI wrapper for a command line program written in C#.
    Perhaps the other thing to consider is that LoganCH's extension requires the full SciTE install to function, per the ReadMe
    Obviously I'm biased; I don't want to change my extension
  20. Thanks
    seadoggie01 got a reaction from genius257 in Visual Studio Code Extension currently available and future plans for SciTE?   
    While I've been moving away from using AutoIt lately, I started using Visual Studio Extensions about a year ago. I started with Damien/LoganCH's extension because it was the only available option at the time (I think). That said, there were a few issues (I think mostly Code Folding issue #89 - that's still open) with it at the time that caused me to start using genius's extension as soon as it came out. It was slightly choppy at the start, but considering my reduced usage of AutoIt, it's been fairly smooth sailing. Lately, I can't find a single issue with it despite it being "less mature"  But I also use AutoIt for fairly simple things now like making a GUI wrapper for a command line program written in C#.
    Perhaps the other thing to consider is that LoganCH's extension requires the full SciTE install to function, per the ReadMe
    Obviously I'm biased; I don't want to change my extension
  21. Like
    seadoggie01 got a reaction from Hashim in GDIPlus Dispose/Shutdown review   
    I'm not sure if this is what you mean, but here goes:
    Create a UDF that is _GDIPlusEx Wrap each GDIPlus function that creates something in a _GDIPlusEx_* function Store each created object in a global array in the UDF _GDIPlusEx_ShutDown walks through each object and destroys it before calling _GDIPlus_ShutDown I did this once, but of course I can't find it now
    Edit: After re-reading your question, I think I misunderstood, you want to know which functions need to be deleted, don't you? Sorry.
    Edit 2: I used the help file to determine the destructive counterpart to each function (that you used only, this list isn't complete)
    _GDIPlus_Startup
    _GDIPlus_Shutdown _GDIPlus_BitmapCreateFromHBITMAP
    _GDIPlus_BitmapDispose
    _GDIPlus_ImageGetDimension
      _GDIPlus_BitmapCreateFromScan0
    _GDIPlus_BitmapDispose
    _GDIPlus_ImageGetGraphicsContext
    _GDIPlus_GraphicsDispose
    _GDIPlus_GraphicsDrawImageRect
      _GDIPlus_PenCreate
    _GDIPlus_PenDispose
    _GDIPlus_GraphicsDrawRect
      _GDIPlus_BrushCreateSolid
    _GDIPlus_BrushDispose
    _GDIPlus_StringFormatCreate
    _GDIPlus_StringFormatDispose
    _GDIPlus_FontFamilyCreate
    _GDIPlus_FontFamilyDispose
    _GDIPlus_FontCreate
    _GDIPlus_FontDispose
    _GDIPlus_RectFCreate
      _GDIPlus_GraphicsMeasureString
      _GDIPlus_GraphicsDrawStringEx
      _GDIPlus_ImageSaveToFile
      _GDIPlus_ImageDispose
      _GDIPlus_Shutdown
     
  22. Like
    seadoggie01 got a reaction from Andreik in AutoIt Snippets   
    Expanding on Nine's task bar adventures... The overlay icon and tooltip were the only other interesting task bar things to me, so I added those + examples
    #include <GUIConstantsEx.au3> #include <WinAPIIcons.au3> ; For _WinAPI_DestroyIcon #include <WinAPIShellEx.au3> ; For _WinAPI_ShellExtractIcon Global Const $sCLSID_TaskbarList = "{56FDF344-FD6D-11D0-958A-006097C9A090}" Global Const $sIID_ITaskbarList3 = "{EA1AFB91-9E28-4B86-90E9-9E9F8A5EEFAF}" Global Const $tagITaskbarList3 = _ "HrInit hresult();" & _ "AddTab hresult(hwnd);" & _ "DeleteTab hresult(hwnd);" & _ "ActivateTab hresult(hwnd);" & _ "SetActiveAlt hresult(hwnd);" & _ "MarkFullscreenWindow hresult(hwnd;boolean);" & _ "SetProgressValue hresult(hwnd;uint64;uint64);" & _ "SetProgressState hresult(hwnd;int);" & _ "RegisterTab hresult(hwnd;hwnd);" & _ "UnregisterTab hresult(hwnd);" & _ "SetTabOrder hresult(hwnd;hwnd);" & _ "SetTabActive hresult(hwnd;hwnd;dword);" & _ "ThumbBarAddButtons hresult(hwnd;uint;ptr);" & _ "ThumbBarUpdateButtons hresult(hwnd;uint;ptr);" & _ "ThumbBarSetImageList hresult(hwnd;ptr);" & _ "SetOverlayIcon hresult(hwnd;ptr;wstr);" & _ "SetThumbnailTooltip hresult(hwnd;wstr);" & _ "SetThumbnailClip hresult(hwnd;ptr);" Example() Func Example() Local $hGUI = GUICreate("AutoIt v3", 400, 100) GUISetState() Local $oTaskBar = TB_Init() TB_ToolTip($oTaskBar, $hGUI, "Working...") ; Load an icon -- this is a blue refresh on Win11 Local $hIcon = _WinAPI_ShellExtractIcon(@SystemDir & "\shell32.dll", 238, 32, 32) TB_SetOverlayIcon($oTaskBar, $hGUI, $hIcon, "Blue refresh") For $i = 1 To 100 TB_SetProgress($oTaskBar, $hGUI, $i, 100) Sleep(25) Next ; Destroy the old icon _WinAPI_DestroyIcon($hIcon) Local $hSecondIcon = _WinAPI_ShellExtractIcon(@SystemDir & "\shell32.dll", 300, 32, 32) TB_SetOverlayIcon($oTaskBar, $hGUI, $hSecondIcon, "Green checkmark") TB_Flash($oTaskBar, $hGUI, 4, 300) TB_ToolTip($oTaskBar, $hGUI, "Waiting for you to close the window") While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Clear the icon overlay TB_SetOverlayIcon($oTaskBar, $hGUI, Null) _WinAPI_DestroyIcon($hSecondIcon) EndFunc ;==>Example Func TB_Init() Local $oTB = ObjCreateInterface($sCLSID_TaskbarList, $sIID_ITaskbarList3, $tagITaskbarList3) $oTB.HrInit() Return $oTB EndFunc ;==>TB_Init Func TB_SetProgress(ByRef $oTB, $hWnd, $iCurrent, $iCompleted) $oTB.SetProgressValue($hWnd, $iCurrent, $iCompleted) EndFunc ;==>TB_SetProgress Func TB_Flash(ByRef $oTB, $hWnd, $iTimes, $iDelay) For $i = 1 To $iTimes $oTB.SetProgressState($hWnd, 0) Sleep($iDelay) $oTB.SetProgressValue($hWnd, 100, 100) Sleep($iDelay) Next $oTB.SetProgressState($hWnd, 0) EndFunc ;==>TB_Flash ; These are icons added to your taskbar icon, showing status usually. Each window only gets 1. Set $hIcon to NULL to clear. ; (Win11) Teams uses this to show your status (busy, free, inactive) and Outlook uses it to show if you have an unread email Func TB_SetOverlayIcon(ByRef $oTB, $hWnd, $hIcon, $sAltText = "") $oTB.SetOverlayIcon($hWnd, $hIcon, $sAltText) EndFunc ;==>TB_SetOverlayIcon ; Depending on settings and version, this may be difficult to see. On Win11 with taskbar previews, it is only visible after hovering over the preview window. Func TB_ToolTip(ByRef $oTB, $hWnd, $sTooltip) $oTB.SetThumbnailTooltip($hWnd, $sTooltip) EndFunc ;==>TB_ToolTip
  23. Like
    seadoggie01 got a reaction from ioa747 in AutoIt Snippets   
    Expanding on Nine's task bar adventures... The overlay icon and tooltip were the only other interesting task bar things to me, so I added those + examples
    #include <GUIConstantsEx.au3> #include <WinAPIIcons.au3> ; For _WinAPI_DestroyIcon #include <WinAPIShellEx.au3> ; For _WinAPI_ShellExtractIcon Global Const $sCLSID_TaskbarList = "{56FDF344-FD6D-11D0-958A-006097C9A090}" Global Const $sIID_ITaskbarList3 = "{EA1AFB91-9E28-4B86-90E9-9E9F8A5EEFAF}" Global Const $tagITaskbarList3 = _ "HrInit hresult();" & _ "AddTab hresult(hwnd);" & _ "DeleteTab hresult(hwnd);" & _ "ActivateTab hresult(hwnd);" & _ "SetActiveAlt hresult(hwnd);" & _ "MarkFullscreenWindow hresult(hwnd;boolean);" & _ "SetProgressValue hresult(hwnd;uint64;uint64);" & _ "SetProgressState hresult(hwnd;int);" & _ "RegisterTab hresult(hwnd;hwnd);" & _ "UnregisterTab hresult(hwnd);" & _ "SetTabOrder hresult(hwnd;hwnd);" & _ "SetTabActive hresult(hwnd;hwnd;dword);" & _ "ThumbBarAddButtons hresult(hwnd;uint;ptr);" & _ "ThumbBarUpdateButtons hresult(hwnd;uint;ptr);" & _ "ThumbBarSetImageList hresult(hwnd;ptr);" & _ "SetOverlayIcon hresult(hwnd;ptr;wstr);" & _ "SetThumbnailTooltip hresult(hwnd;wstr);" & _ "SetThumbnailClip hresult(hwnd;ptr);" Example() Func Example() Local $hGUI = GUICreate("AutoIt v3", 400, 100) GUISetState() Local $oTaskBar = TB_Init() TB_ToolTip($oTaskBar, $hGUI, "Working...") ; Load an icon -- this is a blue refresh on Win11 Local $hIcon = _WinAPI_ShellExtractIcon(@SystemDir & "\shell32.dll", 238, 32, 32) TB_SetOverlayIcon($oTaskBar, $hGUI, $hIcon, "Blue refresh") For $i = 1 To 100 TB_SetProgress($oTaskBar, $hGUI, $i, 100) Sleep(25) Next ; Destroy the old icon _WinAPI_DestroyIcon($hIcon) Local $hSecondIcon = _WinAPI_ShellExtractIcon(@SystemDir & "\shell32.dll", 300, 32, 32) TB_SetOverlayIcon($oTaskBar, $hGUI, $hSecondIcon, "Green checkmark") TB_Flash($oTaskBar, $hGUI, 4, 300) TB_ToolTip($oTaskBar, $hGUI, "Waiting for you to close the window") While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Clear the icon overlay TB_SetOverlayIcon($oTaskBar, $hGUI, Null) _WinAPI_DestroyIcon($hSecondIcon) EndFunc ;==>Example Func TB_Init() Local $oTB = ObjCreateInterface($sCLSID_TaskbarList, $sIID_ITaskbarList3, $tagITaskbarList3) $oTB.HrInit() Return $oTB EndFunc ;==>TB_Init Func TB_SetProgress(ByRef $oTB, $hWnd, $iCurrent, $iCompleted) $oTB.SetProgressValue($hWnd, $iCurrent, $iCompleted) EndFunc ;==>TB_SetProgress Func TB_Flash(ByRef $oTB, $hWnd, $iTimes, $iDelay) For $i = 1 To $iTimes $oTB.SetProgressState($hWnd, 0) Sleep($iDelay) $oTB.SetProgressValue($hWnd, 100, 100) Sleep($iDelay) Next $oTB.SetProgressState($hWnd, 0) EndFunc ;==>TB_Flash ; These are icons added to your taskbar icon, showing status usually. Each window only gets 1. Set $hIcon to NULL to clear. ; (Win11) Teams uses this to show your status (busy, free, inactive) and Outlook uses it to show if you have an unread email Func TB_SetOverlayIcon(ByRef $oTB, $hWnd, $hIcon, $sAltText = "") $oTB.SetOverlayIcon($hWnd, $hIcon, $sAltText) EndFunc ;==>TB_SetOverlayIcon ; Depending on settings and version, this may be difficult to see. On Win11 with taskbar previews, it is only visible after hovering over the preview window. Func TB_ToolTip(ByRef $oTB, $hWnd, $sTooltip) $oTB.SetThumbnailTooltip($hWnd, $sTooltip) EndFunc ;==>TB_ToolTip
  24. Like
    seadoggie01 got a reaction from Nine in AutoIt Snippets   
    Expanding on Nine's task bar adventures... The overlay icon and tooltip were the only other interesting task bar things to me, so I added those + examples
    #include <GUIConstantsEx.au3> #include <WinAPIIcons.au3> ; For _WinAPI_DestroyIcon #include <WinAPIShellEx.au3> ; For _WinAPI_ShellExtractIcon Global Const $sCLSID_TaskbarList = "{56FDF344-FD6D-11D0-958A-006097C9A090}" Global Const $sIID_ITaskbarList3 = "{EA1AFB91-9E28-4B86-90E9-9E9F8A5EEFAF}" Global Const $tagITaskbarList3 = _ "HrInit hresult();" & _ "AddTab hresult(hwnd);" & _ "DeleteTab hresult(hwnd);" & _ "ActivateTab hresult(hwnd);" & _ "SetActiveAlt hresult(hwnd);" & _ "MarkFullscreenWindow hresult(hwnd;boolean);" & _ "SetProgressValue hresult(hwnd;uint64;uint64);" & _ "SetProgressState hresult(hwnd;int);" & _ "RegisterTab hresult(hwnd;hwnd);" & _ "UnregisterTab hresult(hwnd);" & _ "SetTabOrder hresult(hwnd;hwnd);" & _ "SetTabActive hresult(hwnd;hwnd;dword);" & _ "ThumbBarAddButtons hresult(hwnd;uint;ptr);" & _ "ThumbBarUpdateButtons hresult(hwnd;uint;ptr);" & _ "ThumbBarSetImageList hresult(hwnd;ptr);" & _ "SetOverlayIcon hresult(hwnd;ptr;wstr);" & _ "SetThumbnailTooltip hresult(hwnd;wstr);" & _ "SetThumbnailClip hresult(hwnd;ptr);" Example() Func Example() Local $hGUI = GUICreate("AutoIt v3", 400, 100) GUISetState() Local $oTaskBar = TB_Init() TB_ToolTip($oTaskBar, $hGUI, "Working...") ; Load an icon -- this is a blue refresh on Win11 Local $hIcon = _WinAPI_ShellExtractIcon(@SystemDir & "\shell32.dll", 238, 32, 32) TB_SetOverlayIcon($oTaskBar, $hGUI, $hIcon, "Blue refresh") For $i = 1 To 100 TB_SetProgress($oTaskBar, $hGUI, $i, 100) Sleep(25) Next ; Destroy the old icon _WinAPI_DestroyIcon($hIcon) Local $hSecondIcon = _WinAPI_ShellExtractIcon(@SystemDir & "\shell32.dll", 300, 32, 32) TB_SetOverlayIcon($oTaskBar, $hGUI, $hSecondIcon, "Green checkmark") TB_Flash($oTaskBar, $hGUI, 4, 300) TB_ToolTip($oTaskBar, $hGUI, "Waiting for you to close the window") While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Clear the icon overlay TB_SetOverlayIcon($oTaskBar, $hGUI, Null) _WinAPI_DestroyIcon($hSecondIcon) EndFunc ;==>Example Func TB_Init() Local $oTB = ObjCreateInterface($sCLSID_TaskbarList, $sIID_ITaskbarList3, $tagITaskbarList3) $oTB.HrInit() Return $oTB EndFunc ;==>TB_Init Func TB_SetProgress(ByRef $oTB, $hWnd, $iCurrent, $iCompleted) $oTB.SetProgressValue($hWnd, $iCurrent, $iCompleted) EndFunc ;==>TB_SetProgress Func TB_Flash(ByRef $oTB, $hWnd, $iTimes, $iDelay) For $i = 1 To $iTimes $oTB.SetProgressState($hWnd, 0) Sleep($iDelay) $oTB.SetProgressValue($hWnd, 100, 100) Sleep($iDelay) Next $oTB.SetProgressState($hWnd, 0) EndFunc ;==>TB_Flash ; These are icons added to your taskbar icon, showing status usually. Each window only gets 1. Set $hIcon to NULL to clear. ; (Win11) Teams uses this to show your status (busy, free, inactive) and Outlook uses it to show if you have an unread email Func TB_SetOverlayIcon(ByRef $oTB, $hWnd, $hIcon, $sAltText = "") $oTB.SetOverlayIcon($hWnd, $hIcon, $sAltText) EndFunc ;==>TB_SetOverlayIcon ; Depending on settings and version, this may be difficult to see. On Win11 with taskbar previews, it is only visible after hovering over the preview window. Func TB_ToolTip(ByRef $oTB, $hWnd, $sTooltip) $oTB.SetThumbnailTooltip($hWnd, $sTooltip) EndFunc ;==>TB_ToolTip
  25. Like
    seadoggie01 got a reaction from argumentum in AutoIt Snippets   
    Expanding on Nine's task bar adventures... The overlay icon and tooltip were the only other interesting task bar things to me, so I added those + examples
    #include <GUIConstantsEx.au3> #include <WinAPIIcons.au3> ; For _WinAPI_DestroyIcon #include <WinAPIShellEx.au3> ; For _WinAPI_ShellExtractIcon Global Const $sCLSID_TaskbarList = "{56FDF344-FD6D-11D0-958A-006097C9A090}" Global Const $sIID_ITaskbarList3 = "{EA1AFB91-9E28-4B86-90E9-9E9F8A5EEFAF}" Global Const $tagITaskbarList3 = _ "HrInit hresult();" & _ "AddTab hresult(hwnd);" & _ "DeleteTab hresult(hwnd);" & _ "ActivateTab hresult(hwnd);" & _ "SetActiveAlt hresult(hwnd);" & _ "MarkFullscreenWindow hresult(hwnd;boolean);" & _ "SetProgressValue hresult(hwnd;uint64;uint64);" & _ "SetProgressState hresult(hwnd;int);" & _ "RegisterTab hresult(hwnd;hwnd);" & _ "UnregisterTab hresult(hwnd);" & _ "SetTabOrder hresult(hwnd;hwnd);" & _ "SetTabActive hresult(hwnd;hwnd;dword);" & _ "ThumbBarAddButtons hresult(hwnd;uint;ptr);" & _ "ThumbBarUpdateButtons hresult(hwnd;uint;ptr);" & _ "ThumbBarSetImageList hresult(hwnd;ptr);" & _ "SetOverlayIcon hresult(hwnd;ptr;wstr);" & _ "SetThumbnailTooltip hresult(hwnd;wstr);" & _ "SetThumbnailClip hresult(hwnd;ptr);" Example() Func Example() Local $hGUI = GUICreate("AutoIt v3", 400, 100) GUISetState() Local $oTaskBar = TB_Init() TB_ToolTip($oTaskBar, $hGUI, "Working...") ; Load an icon -- this is a blue refresh on Win11 Local $hIcon = _WinAPI_ShellExtractIcon(@SystemDir & "\shell32.dll", 238, 32, 32) TB_SetOverlayIcon($oTaskBar, $hGUI, $hIcon, "Blue refresh") For $i = 1 To 100 TB_SetProgress($oTaskBar, $hGUI, $i, 100) Sleep(25) Next ; Destroy the old icon _WinAPI_DestroyIcon($hIcon) Local $hSecondIcon = _WinAPI_ShellExtractIcon(@SystemDir & "\shell32.dll", 300, 32, 32) TB_SetOverlayIcon($oTaskBar, $hGUI, $hSecondIcon, "Green checkmark") TB_Flash($oTaskBar, $hGUI, 4, 300) TB_ToolTip($oTaskBar, $hGUI, "Waiting for you to close the window") While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Clear the icon overlay TB_SetOverlayIcon($oTaskBar, $hGUI, Null) _WinAPI_DestroyIcon($hSecondIcon) EndFunc ;==>Example Func TB_Init() Local $oTB = ObjCreateInterface($sCLSID_TaskbarList, $sIID_ITaskbarList3, $tagITaskbarList3) $oTB.HrInit() Return $oTB EndFunc ;==>TB_Init Func TB_SetProgress(ByRef $oTB, $hWnd, $iCurrent, $iCompleted) $oTB.SetProgressValue($hWnd, $iCurrent, $iCompleted) EndFunc ;==>TB_SetProgress Func TB_Flash(ByRef $oTB, $hWnd, $iTimes, $iDelay) For $i = 1 To $iTimes $oTB.SetProgressState($hWnd, 0) Sleep($iDelay) $oTB.SetProgressValue($hWnd, 100, 100) Sleep($iDelay) Next $oTB.SetProgressState($hWnd, 0) EndFunc ;==>TB_Flash ; These are icons added to your taskbar icon, showing status usually. Each window only gets 1. Set $hIcon to NULL to clear. ; (Win11) Teams uses this to show your status (busy, free, inactive) and Outlook uses it to show if you have an unread email Func TB_SetOverlayIcon(ByRef $oTB, $hWnd, $hIcon, $sAltText = "") $oTB.SetOverlayIcon($hWnd, $hIcon, $sAltText) EndFunc ;==>TB_SetOverlayIcon ; Depending on settings and version, this may be difficult to see. On Win11 with taskbar previews, it is only visible after hovering over the preview window. Func TB_ToolTip(ByRef $oTB, $hWnd, $sTooltip) $oTB.SetThumbnailTooltip($hWnd, $sTooltip) EndFunc ;==>TB_ToolTip
×
×
  • Create New...