Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

[module] Tray 2.1


  • Please log in to reply
30 replies to this topic
majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006

glanced at code but did not see, is there a reason is placing only lo-res version of icons ?

You can check Appbar sample to see how I put hi-res icons in the toolbar using custom IL module. This sample is not intended to demonstrate how to show hi res icons, but how to extract icon information and send click to icons. Thats why you get different sort of icons in the GUI.
Posted Image

  • Guests
  • Last active:
  • Joined: --
Hi majkinetor and all.

I am trying to work out a nice way for the user to get a text list of all trey icon items, select one from a list view, and then go to a button for left click (or for right click)

I found the tray module - which seems to offer some hope of being able to do this reliably... I wondered if you might give some advice or suggest a way to do what I am wanting to do...

Basically, it would be:
* User presses a given hotkey shortcut and a standard list view would open on the screen
* The list view would have each tray icon (the text could be whatever meaningful label was available - either the tooltip or a label provided by the app, or untitled if none available).
* the user can scroll through the list to whichever item they want.
* the user can tab to a button for left click (which would be the default action on pressing enter) or to a right click button.
* There would be a cancel button also (esc would do this as well)
* If the user selects to left click or right click, the list view disappears and keyboard focus is moved to the tray where the given left or right click action is taken and the user can proceed from there
* Cancel (esc) would also end the script with no action taken and the list view would disappear.

Any advice and help on this would be appreciated.

Mat.

  • Guests
  • Last active:
  • Joined: --
Hey guys... its been a while since something was posted here... wondered if the thread is dead and we need to look elsewhere now to discuss tray stuff as it relates to autohotkey?stuff

Wicked
  • Members
  • 504 posts
  • Last active: Nov 18 2018 02:17 AM
  • Joined: 07 Jun 2008
majkinetor, just allow me to, once again, thank you for the many modules, scripts, and examples you continually provide for this forum. Your scripts are a fantastic help and your excellent documentation and support are also great!

3nL8f.png


Funny_Monster_Teddy
  • Guests
  • Last active:
  • Joined: --
I noticed majkinetor has been MIA (Missing In Action) for quite a while? Am I mistaken?

Posted Image :lol:

  • Guests
  • Last active:
  • Joined: --
Reading this script I've noticed several problems:

1. It uses the dll function PrivateExtractIcons which "is not intended for general use. It may be altered or unavailable in subsequent versions of Windows"
see msdn

2. It doesn't take into account character codification and so tooltips dont display anything or just the first character or else display gibberish

3. It uses double derefs incorreclty in the function "Tray" and so all variables end up being globals (which is not the intended behavior) see this topic

kenn
  • Members
  • 407 posts
  • Last active: Jan 14 2015 08:16 PM
  • Joined: 11 Oct 2010
Hi majkinetor, it's a great script, thanks a lot for your contributions. I want to extract tray icons by grabbing their handles, though I looked for it I couldn't find a way on AHK or I missed it. Is this possible for your script? How can I get handle of an icon and exract it to desktop? It turns out to be an obsession for me:) I hope you post a solution. Thanks.
Edit: Somehow I found a solution I think. Solved

shinomura
  • Members
  • 1 posts
  • Last active: Aug 25 2012 10:09 AM
  • Joined: 25 Aug 2012
link dead, anyone have a copy? please...

redgum
  • Members
  • 59 posts
  • Last active: Mar 26 2015 01:30 AM
  • Joined: 07 Dec 2007
Also looking for a copy of this...

Thanks!

ruespe
  • Members
  • 567 posts
  • Last active: Dec 01 2014 07:59 PM
  • Joined: 17 Jun 2008
I think, this is version 2.1 of majkinators script
Spoiler


redgum
  • Members
  • 59 posts
  • Last active: Mar 26 2015 01:30 AM
  • Joined: 07 Dec 2007
Great, thanks ruespe!

Now that I have the code, I need to work out how to use it. Does anyone have a copy of the documentation?

ruespe
  • Members
  • 567 posts
  • Last active: Dec 01 2014 07:59 PM
  • Joined: 17 Jun 2008
Found in Google-history: http://mm-autohotkey.../Tray/Tray.html

redgum
  • Members
  • 59 posts
  • Last active: Mar 26 2015 01:30 AM
  • Joined: 07 Dec 2007
Thanks again, ruespe!

redgum
  • Members
  • 59 posts
  • Last active: Mar 26 2015 01:30 AM
  • Joined: 07 Dec 2007
This works great - in Windows 7. However, it doesn't work at all on my Windows 8 box…

Machine 1: Windows 7 Ultimate SP1 64-bit, running AHK v1.1.9.0 Unicode 32-bit

Machine 2: Windows 8 Enterprise RTM, running AHK v1.1.9.0 Unicode 64-bit

#include tray.ahk
^!z::	
DetectHiddenWindows On
IfWinExist ahk_class EVERYTHING_TASKBAR_NOTIFICATION
{
pos := Tray_Define("everything.exe", "i")
msgbox % pos
}
else
msgbox % "doesn't exist"
DetectHiddenWindows Off
return

For machine 1, msgbox displays "2", as expected.

For machine 2, msgbox displays empty…

Does anyone else have tray.ahk running in Windows 8?

automator
  • Members
  • 7 posts
  • Last active: Jul 23 2014 08:39 PM
  • Joined: 20 Aug 2013

For me too tray.ahk doesn't work on 64-bit AHK. Installing 32-bit AHK makes it work perfectly.
Thanks redgum, your machine 1 and machine 2 information helped me solve the annoying problem.