Re:UDF _GetTrayBarPos( ), Determine TrayBar Position
"valery_vi" <[email protected]>
| Newsgroups | gmane.comp.windows.autoit.user |
|---|---|
| Message-ID | <[email protected]> |
BTW I have explored Shell Tray window and it's properties.
The result is two tricky functions:
;Sets the transparency of the Shell Tray Window
Func ShellTrayTrans($Transparency)
Opt("WinTitleMatchMode", 4)
WinActivate('classname=Shell_TrayWnd', '')
WinSetTrans('classname=Shell_TrayWnd', '', $Transparency)
EndFunc
;Restore Shell Tray Window
Func ShellTrayRestore()
Opt("WinTitleMatchMode", 4)
WinActivate('classname=Progman', '')
WinSetTrans('classname=Shell_TrayWnd', '', 255)
EndFunc
So if you will try following:
$Transparency = 170
ShellTrayTrans($Transparency)
Sleep (2000)
ShellTrayRestore()
then Shell Tray window will be OK. But you can transform Shell Tray
into hidden window, too:
$Transparency = 0
ShellTrayTrans($Transparency)
Sleep (2000)
;ShellTrayRestore()
without restoring it's default properties.
Important note: Windows XP can't autorestore the main control (Shell
Tray window) of desktop! It's bad in many cases, I think.
Valery
--- In [email protected], "valery_vi" <shehrer1@...> wrote:
>
> Someone (bugfix!) from AutoItScript wrote:
> http://www.autoitscript.com/forum/index.php?showtopic=39076
>
> "..
> In some cases you need the TrayBar position. I've made a solution
for
> this.
> "
>
> His solution isn't valid in my case.
> So I wrote other one. It can be called as ShellTrayPos():
>
> Msgbox(0,'', ShellTrayPos())
>
> ;Get type of Shell Tray Window position
> Func ShellTrayPos()
> Opt("WinTitleMatchMode", 4)
> $ShellTrayPos = WinGetPos('classname=Shell_TrayWnd', '')
> $Left = $ShellTrayPos[0]
> $Top = $ShellTrayPos[1]
> $Width = $ShellTrayPos[2]
> $Height = $ShellTrayPos[3]
> if $Left <= 0 then
> if $Top <= 0 then
> if $Width > $Height then
> return 'Top'
> else
> return 'Left'
> endif
> else
> return 'Bottom'
> endif
> else
> return 'Right'
> endif
>
> EndFunc
>
> It isn't symmetric like can be expected at first sight but it works
> for my hidden and left-side tray.
>
> Valery
>