Sign in to follow this  
Followers 0
NicoTn

Minimize to tray

11 posts in this topic

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]

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

To hide and restore your Gui then you are going to need to use the Tray*() functions.

:whistle:

Edited by MHz

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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]

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