Jump to content

DesktopHeight without taskbar?


Kip
 Share

Recommended Posts

  • Moderators

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.

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

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)
Link to comment
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
 Share

  • Recently Browsing   0 members

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