Jump to content

Recommended Posts

Posted

Here you go....

Opt("WinTitleMatchMode", 4)
$get=ControlGetPos("classname=Shell_TrayWnd", "", "ReBarWindow321")

$Height_Minus_Taskbar=@DesktopHeight-$get[3]
  • Moderators
Posted (edited)

What if the taskbar is on one of the sides?

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.

  • Moderators
Posted

I was thinking about this thread as I was walking out the door, try this and see if you get the results you want (haven't tested it yet):

#include <Array.au3>
$aDTWH = _DeskTopVisibleArea()
_ArrayDisplay($aDTWH)
Func _DeskTopVisibleArea()
    Local $aInfo[2]
    Local $aCPos = ControlGetPos('[CLASS:Shell_TrayWnd]', '', '')
    If IsArray($aCPos) = 0 Then
        $aInfo[0] = @DesktopWidth
        $aInfo[1] = @DesktopHeight
    ElseIf $aCPos[2] = @DesktopWidth Then
        $aInfo[0] = @DesktopWidth
        $aInfo[1] = @DesktopHeight - ($aCPos[3] - $aCPos[1])
    Else
        $aInfo[0] = @DesktopWidth - ($aCPos[2] - $aCPos[0])
        $aInfo[1] = @DesktopHeight
    EndIf
    Return $aInfo
EndFunc

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.

Posted (edited)

See this link

#400358

function to get desktop work area rectangle. Then it's a matter of subtracting top from bottom.

Edited by Siao

"be smart, drink your wine"

Posted

What if the taskbar is on one of the sides?

Good point Smoke_N! From the picture, I figured it would be always on the bottom but the best way would be two figure out where it would and then do the calculation.

  • Moderators
Posted

Smoke_N's script doesnt work. is that true or is is just me? (or vista:)

What do you mean by "doesn't" work?

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.

  • Moderators
Posted

what i say: Doesnt work

Why don't you explain what in the world you mean by "doesn't" work... Amazing you actually want help, and you can't even provide any type of details other than "doesn't work" pfft :) ...

ie...

Doesn't give any results at all.

Doesn't give the right results.

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.

Posted

ok, it always returned -4 as width

but my own version works (not so different)

$aCPos = ControlGetPos("[CLASS:Shell_TrayWnd]","","")
    
$Width = @DesktopWidth
$Height = @DesktopHeight

If $aCPos[3] > $aCPos[2] Then
    $Width = @DesktopWidth-$aCPos[2]
Else
    $Height = @DesktopHeight-$aCPos[3]
EndIf

MsgBox(0,"dd", $Width&","&$Height)

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
×
×
  • Create New...