Jump to content

traymenu anywhere


legend
 Share

Recommended Posts

I have the following code that will show the traymenu when you press enter,

there's a problem that it will first show the traymenu if you click the tray icon, and then press "T". if you don't click the tray icon first, before pressing T,

it will show: script paused, and exit when you press T.

Does anyone know how to fix that? :)

#include <Constants.au3>

Opt("TrayMenuMode", 1)
Opt("WinTitleMatchMode", 4)

Global Const $WM_USER           = 0x0400
Global Const $MY_WM_NOTIFYICON  = $WM_USER + 1
Global Const $WM_LBUTTONDOWN    = 0x0201

$aboutItem  = TrayCreateItem("About")
TrayCreateItem("")
$exitItem   = TrayCreateItem("Exit")

TraySetState()

HotKeySet("t", "ShowTrayMenu") ; Ctrl + Alt + t

While 1
    $Msg = TrayGetMsg()
    Switch $Msg
        Case $exitItem
            ExitLoop
        Case $aboutItem
            Msgbox(0, "Info", "Just for fun...")
    EndSwitch
WEnd

Exit

Func ShowTrayMenu()
    DllCall("user32.dll", "int", "SendMessage", _
                                "hwnd", WinGetHandle("classname=AutoIt v3"), _
                                "int", $MY_WM_NOTIFYICON, _
                                "int", 0, _
                                "int", $WM_LBUTTONDOWN)
EndFunc

 

Edited by legend
Link to comment
Share on other sites

I got a somewhat nice result with

Opt("TrayAutoPause", 0)
Opt("TrayMenuMode", 3)

But the first time the menu shows it's always the default with the "script pause / exit" entries, from there on, it shows the ones you set.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

4 hours ago, careca said:

I got a somewhat nice result with

Opt("TrayAutoPause", 0)
Opt("TrayMenuMode", 3)

But the first time the menu shows it's always the default with the "script pause / exit" entries, from there on, it shows the ones you set.

didn't seem to have any effect for me, still comes up with pause script everything you press the hoykey, first when you click on the tray icon,

and then click the hotkey once again, the real menu will appear

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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