Jump to content

AutoIt Window Info Size greater than size of screen


Recommended Posts

I have a 27 inch display with 2560x1440 pixels on a x64 machine running IE11 and Win7x64 and AutoIt  (3.3.14.2).

When I use AutoIt V3 Window Information, the Size is shown as 2572, 1452
Which exceeds the size of the display.

When I use RDP to a 32 bit remote machine, 
I get 2574, 1454

I'm having trouble getting consistent screen coordinates for mouse clicking in a fillable PDF in IE11.

Is there something I should do to get consistent and correct screen co-ordinates?

thanks!

Phil

 

Link to comment
Share on other sites

Doesn't calibration typically deal with COLOR?

Are you talking about centering the display on the screen so that the entire image shows?

1 hour ago, AutoBert said:

Your display is not correct calibrated, look in manufacturer note how to do this.

 

Link to comment
Share on other sites

John - 
The window is maximized.
I always have it positioned on the second of my 4 displays.

My question was not about the POSITION of the window,
but rather,
the SIZE of the window.
How could it legitimately be larger than the SIZE of the display?

 

>>..., and it is common for a windows position to exceed screen size. <<

Link to comment
Share on other sites

By position, I meant also size L T H W.

The chrome window I am using right now maximized, I can see no borders, that is because it's position puts the borders off screen intentionally.

For example you can use WinMove and put any window x position at -2 and its width at Desktop width +4, your  window is now 4 pixels wider than your visible display.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Wow - thanks for the insights.

I can see how one might do that with WinMove - but, it seem surprising that MAXIMZE would make something larger than the maximum size of the screen on which the window is placed.

Is there any way to get the true screen size so that we can programatically account for the amount of overscan (if overscan is the correct term)?

 

Link to comment
Share on other sites

True screen size, do you mean the virtual desktop? I'm using this function in a script I'm currently working on.

Func GetDesktopMetrics()
    Return _GDIPlus_RectFCreate(_WinAPI_GetSystemMetrics($SM_XVIRTUALSCREEN), _WinAPI_GetSystemMetrics($SM_YVIRTUALSCREEN), _
            _WinAPI_GetSystemMetrics($SM_CXVIRTUALSCREEN), _WinAPI_GetSystemMetrics($SM_CYFULLSCREEN))
EndFunc   ;==>GetDesktopMetrics

returns a tagRECTF struct with the x, y, width, and height of the virtual desktop. Accounting for multiple monitors. I have two monitors setup on for my computer and the second one is to the left of the main, and all of the coordinates for it are in the negative, so @DesktopWidth won't recognize my real desktop width.

And this returns a struct with the metrics for a dialog (gui). Caption is the height of the title bar, x border, y border, x dialog frame, and y dialog frame.

Func GetDialogMetrics()
    Local $tStruct = DllStructCreate("struct;long caption;long xBorder;long yBorder;long xDlgFrame;long yDlgFrame;endstruct")
    For $iSysMetric = $SM_CYCAPTION To $SM_CYDLGFRAME
        DllStructSetData($tStruct, $iSysMetric - $SM_CYCAPTION + 1, _WinAPI_GetSystemMetrics($iSysMetric))
        ConsoleWrite(_WinAPI_GetSystemMetrics($iSysMetric) & @CRLF)
    Next
    Return $tStruct
EndFunc   ;==>GetDialogMetrics

You can use

BitAND(WinGetState("Title"), 32)

To determine if the window is maximized. (The help file says you can use $WIN_STATE_* to determine the state but none of those variables are actually declared in any of the files in the include folder.)

Link to comment
Share on other sites

On 4/1/2016 at 10:05 PM, InunoTaishou said:

You can use

BitAND(WinGetState("Title"), 32)

To determine if the window is maximized. (The help file says you can use $WIN_STATE_* to determine the state but none of those variables are actually declared in any of the files in the include folder.)

Thanks - But, I'd like to know the size of the screen on which the window is maximized.

As noted earlier by JohnOne, the size for a maximized window may exceed the size of the display on which it is placed.
Which makes it hard to adjust mouse clicks to cater for different size displays.

I'm developing on a machine with 4 displays - the left is 1200x1920 in portrait mode.
Then next 2 are 2560x1440 in landscape 
and the righmost is 1200x1920 in portrait.
I'd like to be able to calculate mouse positions to click on a PDF showing in IE11 for various sized screens such as 1080x1200 portrait.
Is there some easy way to do this?

thanks again.
Phil

 

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