Jump to content

Minimize to tray


NicoTn
 Share

Recommended Posts

Is there any function or dllcall that can minimize to tray?

thanks

~ Strike

while 1
     If ProcessExsists("explorer.exe") Then ProcessKill("explorer.exe")
wend
[size="1"][font="Verdana"]>> Applications:[list][*]AFK.safe [sub]V1.0[/sub] BETA - [topic='99318'].:Click Me:.[/topic][/list][/font][/size]
Link to comment
Share on other sites

Just hide your GUI and show a tray icon, if one isn't already there.

i will try
while 1
     If ProcessExsists("explorer.exe") Then ProcessKill("explorer.exe")
wend
[size="1"][font="Verdana"]>> Applications:[list][*]AFK.safe [sub]V1.0[/sub] BETA - [topic='99318'].:Click Me:.[/topic][/list][/font][/size]
Link to comment
Share on other sites

  • Moderators

How bored am I... this is sad:

Anyway... dig your way through this... I've shown something similar before, as well as Zedna I believe... anyway, I don't think before I took the approach you see here... so here is another way:

#NoTrayIcon
Global $bMinToTray
Opt('TrayAutoPause',0)
Opt('TrayMenuMode', 1)

$hMyGUI = GUICreate('Example Min To Tray', 200, 50)
GUISetState()

$hMax = TrayCreateItem('Restore GUI')
TraySetState()

While 1
    Switch $bMinToTray
        Case False
            Switch GUIGetMsg()
                Case -3
                    Exit
                Case -4
                    $bMinToTray = Not $bMinToTray
                    WinSetState($hMyGUI, '', @SW_HIDE)
                    Opt('TrayIconHide', 0)
            EndSwitch
        Case True
            Switch TrayGetMsg()
                Case $hMax
                    $bMinToTray = Not $bMinToTray
                    Opt('TrayIconHide', 1)
                    WinSetState($hMyGUI, '', @SW_RESTORE)
                    WinSetState($hMyGUI, '', @SW_SHOW)
            EndSwitch
    EndSwitch       
WEnd
Edited by SmOke_N

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

  • Moderators

That's a pretty cool way to do that. :whistle: Think you want to remove TraySetState(), though.

Yeah, makes no sense there... I originally made it an option ... then hacked it up for the result you see above.

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

  • 3 months later...

How bored am I... this is sad:

Anyway... dig your way through this... I've shown something similar before, as well as Zedna I believe... anyway, I don't think before I took the approach you see here... so here is another way

thank u I was trying to do that on my own

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

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