- If people have some useful information to share re. this, there is a chance, a small chance, that I might look into it more seriously. Unlike with other projects, I cannot easily estimate the difficulty.
- Obviously, if people help contribute to my object queries (e.g. here/in Ask For Help), this makes things more likely.
- Anyhow, there is one example, that I am definitely interested in. That is A_TrayMenu. I've attempted to backport A_TrayMenu.ClickCount := 1 to AHK v1, for my AHK v2 functions for AHK v1 library. I've succeeded, although I would welcome any suggestions/improvements to the script. In particular could I simply create a class called A_TrayMenu, instead of creating an instance of a class called A_TrayMenu.
- This was useful:
GeekDude's tips and tricks - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=7190
- AHK v1-only backport of A_TrayMenu.ClickCount.Make a function call itself on script start (Useful for init functions). Note this can also work with classesCode: Select all
MyFunction() { Static Dummy := MyFunction() MsgBox, I see you %A_UserName% }
Code: Select all
q::
A_TrayMenu.ClickCount := 1
return
w::
A_TrayMenu.ClickCount := 2
return
global A_TrayMenu
TrayMenuInit()
{
static vDummy := TrayMenuInit()
global A_TrayMenu := new TrayMenuClass ;note: 'global' can be omitted here since A_TrayMenu is super-global
}
class TrayMenuClass
{
__Set(vKey, vValue)
{
if (vKey = "ClickCount")
Menu, Tray, Click, % vValue
return
}
}
Menu
https://autohotkey.com/docs/commands/Menu.htm
Menu Object
https://lexikos.github.io/v2/docs/objects/Menu.htm
TraySetIcon
https://lexikos.github.io/v2/docs/comma ... etIcon.htm
GUI
https://autohotkey.com/docs/commands/Gui.htm
GuiCreate
https://lexikos.github.io/v2/docs/comma ... Create.htm