Jump to content

Minimize to Tray?


confutatis
 Share

Recommended Posts

  • Moderators

CyberSlug wrote this I believe:

#include <GuiConstants.au3>
Global Const $TRAY_DEFAULT  = 512

#NoTrayIcon;at least not icon at the very beginning
Opt("TrayAutoPause", 0)
Opt("TrayMenuMode", 1)

GuiCreate("Minimzes to tray")
GuiSetState(@SW_SHOW)

$foo = TrayCreateItem("Restore Window")
TrayItemSetState(-1, $TRAY_DEFAULT)
TraySetClick ( 0 );don't show menu item when clicked
TraySetToolTip("Click to restore window...");Does this function work?

While 1
    $trayMsg = TrayGetMsg()
    If $trayMsg = $foo Then
        GuiSetState(@SW_SHOW);show GUI
        Opt("TrayIconHide", 1);hide tray icon
    EndIf
    
    $msg = GuiGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
    
    If $msg = $GUI_EVENT_MINIMIZE Then
        GuiSetState(@SW_HIDE);hide GUI
        Opt("TrayIconHide", 0);show tray icon
    EndIf
WEnd

Edit: Need to use Beta with this...

Edited by ronsrules

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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...