Sign in to follow this  
Followers 0
confutatis

Minimize to Tray?

5 posts in this topic

Hello to all...

I'm wondering if there is a way to minimize an AutoIT GUI window to the tray, instead of the task bar. This would make for less clutter.

Regards,

David

Share this post


Link to post
Share on other sites



There is a freeware program available to do this: Powermenu. It adds a few menu items, including Minimize to Tray, to the title bar menu of any open window.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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.

Share this post


Link to post
Share on other sites

Specifically, what I'd like to do is minimize my GUI window to the system tray when the user clicks on the minimize button.

David

Share this post


Link to post
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
Sign in to follow this  
Followers 0