Jump to content

Recommended Posts

Posted

I often have a few AutoIt scripts running at once and, partially out of laziness, they all have the same icon which is a bit confusing. Normally, I only need to see a single script that I use to launch other scripts/programs/etc. I'd like to move all of the "extra" scripts to the hidden icons section, however if I drag a single icon, they all move to the hidden section.

After looking at the documentation for Shell_NotifyIcon, it looks like this might be an undocumented feature of using the same window handle for each AutoIt script's icon... in this case it's likely the AutoItWindow. My first thought was to update each icon to have a different window handle. The NotifyIconDataA structure requires a uID to update the tray icon and I couldn't find a way to obtain this information without creating the tray myself.

Is there a way to find the uID of the NotifyIconDataA structure that is created by AutoIt?

My second thought was to make a UDF around Shell_NotifyIcon and make trays myself. Has anyone else created something similar (I couldn't find any) or should I start making one?

In the meantime, I'll start making some icons (ew)

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Posted

Hello @seadoggie01.  :)

Not exactly sure where you are heading with this.   Why Tray* functions do not suffice ?
Maybe providing a snippet of the non-working code could help to understand your issue.

FYI, tray icon uID of AutoIt hidden window is 1.  See :

#include <WinAPIShellEx.au3>

Local $tNOTIFYICONDATA = DllStructCreate($tagNOTIFYICONDATA)
DllStructSetData($tNOTIFYICONDATA, 'Size', DllStructGetSize($tNOTIFYICONDATA))
DllStructSetData($tNOTIFYICONDATA, 'hWnd', WinGetHandle(AutoItWinGetTitle()))
DllStructSetData($tNOTIFYICONDATA, 'Flags', $NIF_ICON)

Sleep(1000) ; show icon for one sec

DllStructSetData($tNOTIFYICONDATA, 'ID', 1)
_WinAPI_ShellNotifyIcon($NIM_DELETE, $tNOTIFYICONDATA) ; delete current tray icon of running script

Sleep(10000)

 

Posted
31 minutes ago, Nine said:

Not exactly sure where you are heading with this.

He wants to have scripts to show icons independently as if from different executables so that scripts are not treated as if from the same executable, as they obviously are.
I guess a full "Notifications and the Notification Area" UDF

I think that is worth it.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted

@Nine If you run two scripts at once, you're not able to move just one of the tray icons to the "Show hidden icons" section of the Taskbar. I have a few scripts that run in the background that I'd like hidden, but another script that I don't want hidden.

If the uID is 1, then I think that should solve my problem... I want to update the window handle associated with the tray icons because that will (I think) allow them to be split. I'll try this out in the morning :)

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Posted
43 minutes ago, seadoggie01 said:

If you run two scripts at once, you're not able to move just one of the tray icons to the "Show hidden icons" section

True

43 minutes ago, seadoggie01 said:

I have a few scripts that run in the background that I'd like hidden

Just create a main icon menu accordingly, for each scripts you started, add a possibility to cancel them ?

46 minutes ago, seadoggie01 said:

If the uID is 1, then I think that should solve my problem...

Well, I still do not fully understand the final objective of your issue.  But I am glad that I could help.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...