Untitled

 avatar
unknown
plain_text
a year ago
1.0 kB
12
Indexable
; Add this code near the top of your script, after the global variable declarations
; but before the ShowGui() function

; Configure the tray icon behavior
A_TrayMenu.Delete() ; Clear default menu items
A_TrayMenu.Add(“Show Oracle Support App”, ShowFromTray)
A_TrayMenu.Add(“Exit”, ExitApp)
A_TrayMenu.Default := “Show Oracle Support App” ; Make this the default double-click action

; Function to show the GUI when called from tray
ShowFromTray(*) {
if IsSet(myGui) {
myGui.Show(“w380 h405”)
myGui.Restore() ; Ensure it’s not minimized
WinActivate(“Oracle Support App”) ; Bring to front
ShowStatusToast(“Oracle Support App restored from tray”, “ready”)
} else {
ShowGui()
}
}

; Optional: Add a hotkey to show/hide the GUI
^!o:: {  ; Ctrl+Alt+O to toggle GUI
if IsSet(myGui) {
try {
if WinExist(“Oracle Support App”) {
myGui.Minimize()
ShowStatusToast(“Oracle Support App minimized to tray”, “info”)
} else {
ShowFromTray()
}
} catch {
ShowGui()
}
} else {
ShowGui()
}
}
Editor is loading...
Leave a Comment