Jump to content

Recommended Posts

Posted

Usually it is simple to dynamically size the GUI just using the @DesktopWidth (i.e. to fill the desktop efficiently).

However, when the user has changed it's taksbar not to be at the bottom, but to be at the left side of the desktop (vertical taskbar) I need to redefine the position of the window. Otherwise the GUI will be partialy covered by the taksbar and needs manually to be moved.

Anyone, who has an idea, how to determine the 0,0-position when the taksbar is on the left side of the screen?

thanks,

Daniel

Posted

Usually it is simple to dynamically size the GUI just using the @DesktopWidth (i.e. to fill the desktop efficiently).

However, when the user has changed it's taksbar not to be at the bottom, but to be at the left side of the desktop (vertical taskbar) I need to redefine the position of the window. Otherwise the GUI will be partialy covered by the taksbar and needs manually to be moved.

Anyone, who has an idea, how to determine the 0,0-position when the taksbar is on the left side of the screen?

thanks,

Daniel

Hi there m8,

Is this code useful for you?

#include <array.au3>

$size = WinGetClientSize("[CLASS:Shell_TrayWnd]","")
_ArrayDisplay($size, "Working Space")

Remember that the include is just for view porposel, you can remove it.

Cheers

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Posted

Hi again,

Using the same method above here's a further way to find where the taskbar is located, Left, Right, Top or Bottom

$aPos = WinGetPos("[CLASS:Shell_TrayWnd]")

If $aPos[0] = 0 And $aPos[1] = 0 And $aPos[3] = @DesktopHeight Then
    ConsoleWrite("Taskbar is on the Left of the screen." & @LF)
ElseIf $aPos[0] > 0 And $aPos[1] = 0 And $aPos[3] = @DesktopHeight Then
    ConsoleWrite("Taskbar is on the Right of the screen." & @LF)
ElseIf $aPos[0] = 0 And $aPos[1] = 0 And  $aPos[2] = @DesktopWidth Then
    ConsoleWrite("Taskbar is on the Top of the screen." & @LF)
ElseIf $aPos[0] = 0 And $aPos[1] > 0 And  $aPos[2] = @DesktopWidth Then
    ConsoleWrite("Taskbar is on the Bottom of the screen." & @LF)   
EndIf

Cheers

Posted

Thanks! That was the hint I needed.

CODE

local $x_offset=0

Local $size = WinGetPos("[CLASS:Shell_TrayWnd]","")

If $size[1]<10 Then ;actually it is -2 when taskbar is docked to the left side

$size = WinGetClientSize("[CLASS:Shell_TrayWnd]","")

x_offset=$size[0]+2

EndIf

Local $handle=GuiCreate("Telnet "&$hostI&":"&$port, 800, 760,5+$x_offset,5)

Posted

Hi again,

Using the same method above here's a further way to find where the taskbar is located, Left, Right, Top or Bottom

$aPos = WinGetPos("[CLASS:Shell_TrayWnd]")

If $aPos[0] = 0 And $aPos[1] = 0 And $aPos[3] = @DesktopHeight Then
    ConsoleWrite("Taskbar is on the Left of the screen." & @LF)
ElseIf $aPos[0] > 0 And $aPos[1] = 0 And $aPos[3] = @DesktopHeight Then
    ConsoleWrite("Taskbar is on the Right of the screen." & @LF)
ElseIf $aPos[0] = 0 And $aPos[1] = 0 And  $aPos[2] = @DesktopWidth Then
    ConsoleWrite("Taskbar is on the Top of the screen." & @LF)
ElseIf $aPos[0] = 0 And $aPos[1] > 0 And  $aPos[2] = @DesktopWidth Then
    ConsoleWrite("Taskbar is on the Bottom of the screen." & @LF)   
EndIf

Cheers

Actually I see that it is set to -2 and not to 0 for the corner.... WinXP SP2

Posted

Actually I see that it is set to -2 and not to 0 for the corner.... WinXP SP2

Not for me..English XP SP2 or XP SP3 autoit v3.3 is what I'm using on 2 of my pcs..

But anyways.. an easy fix..

$aPos = WinGetPos("[CLASS:Shell_TrayWnd]"), $aRet[4]
    If $aPos[0] <= 0 And $aPos[1] <= 0 And $aPos[3] = @DesktopHeight Then
        ConsoleWrite("Taskbar is on the Left of the screen." & @LF)
    ElseIf $aPos[0] > 0 And $aPos[1] <= 0 And $aPos[3] = @DesktopHeight Then
        ConsoleWrite("Taskbar is on the Right of the screen." & @LF)
    ElseIf $aPos[0] <= 0 And $aPos[1] <= 0 And  $aPos[2] = @DesktopWidth Then
        ConsoleWrite("Taskbar is on the Top of the screen." & @LF)
    ElseIf $aPos[0] <= 0 And $aPos[1] > 0 And  $aPos[2] = @DesktopWidth Then
        ConsoleWrite("Taskbar is on the Bottom of the screen." & @LF)
    EndIf

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...