Jump to content

Recommended Posts

Posted

#Include <Constants.au3>
#Include <GUIConstants.au3>
#NoTrayIcon
$win_width = 179
$win_height = 226
$y = @DesktopHeight
$x = @DesktopWidth
$Button1 = False
Opt("TrayMenuMode",1)
TraySetState()
Global $gui = 0
Global $winopen = False

While 1
    Switch TrayGetMsg()
        Case 0
            If $winopen = False Then
                ContinueLoop
            ElseIf $winopen = True And _MouseIsAround() Then
                $winopen = False
                For $y = _GetTaskbar(1) - $win_height To _GetTaskbar(1) Step 20
                    WinMove( "Autoit Tray", "", $x, $y )
                    Sleep(10)
                Next
                GUIDelete($gui)
                GUISetState()
            EndIf
        Case $TRAY_EVENT_PRIMARYDOWN
            gui()
        Case $TRAY_EVENT_SECONDARYDOWN
            gui()
    EndSwitch
    If $winopen = True And GUIGetMsg() = $Button1 Then
        SplashTextOn( "THANK YOU", "EXITING. . .", 150, 50)
        gui()
        Sleep(500)
        Exit
    EndIf
Sleep(10)
WEnd
Exit


Func gui()
    If $winopen = False Then
        $winopen = True
        If MouseGetPos(0) + $win_width < @DesktopWidth Then
            $x = MouseGetPos(0)
        Else
            $x = MouseGetPos(0) - $win_width
        EndIf
        $gui = GUICreate("Autoit Tray", $win_width, $win_height, $x, $y, $WS_POPUP, BitOR($WS_CLIPCHILDREN,$WS_EX_TOOLWINDOW))
        GUICtrlCreateLabel( "YOUR DATA HERE", 30, 30, $win_width )
        GUICtrlSetColor( -1, 0x000000 )
        $Button1 = GUICtrlCreateButton("EXIT", 56, 200, 65, 25, 0)
        GUISetState()
        For $y = _GetTaskbar(1) To _GetTaskbar(1) - $win_height Step -20
            WinMove( "Autoit Tray", "", $x, $y )
            Sleep(10)
        Next
        WinActivate( "Autoit Tray" )
    ElseIf $winopen = True Then
        $winopen = False
        For $y = _GetTaskbar(1) - $win_height To _GetTaskbar(1) Step 20
            WinMove( "Autoit Tray", "", $x, $y )
            Sleep(10)
        Next
        GUIDelete( $gui )
        GUISetState()
    EndIf
EndFunc

Func _GetTaskbar($dimension)
    $s_PrevOpt = Opt("WinTitleMatchMode", 4)
    $return = WinGetPos("Classname=Shell_TrayWnd")
    Opt("WinTitleMatchMode",$s_PrevOpt)
    Return $return[$dimension]
EndFunc

Func _MouseIsAround()
    $mousepos = MouseGetPos()
    $winpos = WinGetPos( "Autoit Tray" )
    Select
        Case $mousepos[0] > $winpos[0] + $winpos[2] + 30
            Return True
        Case $mousepos[1] > $winpos[1] + $winpos[3] + 30
            Return True
        Case $mousepos[0] < $winpos[0] - 30
            Return True
        Case $mousepos[1] < $winpos[1] - 30
            Return True
        Case Else
            Return False
    EndSelect
EndFunc

Check out ConsultingJoe.com
Posted

I just love it

[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]

Posted

:)

That's sweeet now add things in there like pause script exit debug or somehing liek that maybe even a little gui that pops up with xskin isn't a bad idea!

tolle indicium

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
  • Recently Browsing   0 members

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