Sign in to follow this  
Followers 0
BugFix

UDF _GetTrayBarPos( )

3 posts in this topic

In some cases you need the TrayBar position. I've made a solution for this. I've tested it with 2 resolutions (1024 x 768 / 1280 x 1024) and it works fine. I hope it is also valid for other resolutions.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Function:     _GetTrayBarPos()
; 
; Description:  give back TrayBar-Position
; Return Value: 1 = right
;               2 = bottom
;               3 = left
;               4 = top
;
; Author:       BugFix ( bugfix@autoit.de )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func _GetTrayBarPos()
    $TrayBarPos = WinGetPos("", "Notification Area" )
    Select
        Case $TrayBarPos[0] = -4
            If $TrayBarPos[1] = -4 And $TrayBarPos[2] = (@DesktopWidth +8) Then 
                ; Position = "bottom"
                Return 2
            ElseIf $TrayBarPos[1] = -4 And $TrayBarPos[3] = (@DesktopHeight +8) Then
                ; Position = "right" 
                Return 1
            Else
                ; Position = "top"
                Return 4
            EndIf
        Case Else
            ; Position = "left"
            Return 3
    EndSelect
EndFunc ; ==> _GetTrayBarPos()

Best Regards BugFix  

Share this post


Link to post
Share on other sites



In some cases you need the TrayBar position. I've made a solution for this. I've tested it with 2 resolutions (1024 x 768 / 1280 x 1024) and it works fine. I hope it is also valid for other resolutions.

I don't get what this is supposed to do, I just always get a return value of 3... What do you mean by the trayBar?


My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

I don't get what this is supposed to do, I just always get a return value of 3... What do you mean by the trayBar?

It seems to return the same result for me as well.

Win XP SP2

1280x1024


HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

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