WoodGrain

WinGetPos() returns the wrong width/height but Windows Info returns the correct width/height

10 posts in this topic

Hi All,

I'm running the following, but the width and height are wrong, am I doing something wrong?

$xy = WinGetPos($myTitle, "")
$posX = $xy[0]
$posY = $xy[1]
$sizeW = $xy[2]
$sizeH = $xy[3]

Window Info program is returning w:301 x h:1017 which is correct.

WinGetPos() is returning w:92 x h:18, which is completely wrong.

This problem is only happening on 1 program, WinGetPos() is returning correct information for the other programs...

Any thoughts?
Thanks!

Share this post


Link to post
Share on other sites
22 hours ago, WoodGrain said:

This problem is only happening on 1 program, WinGetPos() is returning correct information for the other programs...

and what's the name of this special progrgram? Are you sure you are getting results for the correct window?

Share this post


Link to post
Share on other sites

Hi,

I'm using
$myTitle = "UC-One"

It's a soft phone, I'm 100% sure I'm referencing the correct program, I've used the Window Info tool to get the title.

Thanks.

Share this post


Link to post
Share on other sites

And you are sure there's only one window with this title? Test with Winlist if there's another (hidden?) window.

Share this post


Link to post
Share on other sites

Hi,

I've confirmed with WinList() that this is the only window with this title.

Thanks.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

<snip>

similar problem.

Edited by Melba23
Not at all similar

Share this post


Link to post
Share on other sites

waiwei,

Your problem is NOT similar. Please do not hijack other threads when you already have one running.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Any other ideas what could be causing this problem with AutoIT's WinGetPos()?

Share this post


Link to post
Share on other sites

Have you tried to replace $myTitle in WinGetPos with the window handle as shown by the AutoIt Window Info tool? Or have you tried to check which handle is returned by WinGetHandle( $myTitle, "" )? Does this handle match the handle as shown by the AutoIt Window Info tool?

The problem is probably that this UC-One soft phone is not created with standard MicroSoft windows/controls. It can be made with any development tool for example Java. This means that many of the Win-functions are not able to produce the proper results.

You can try to examine the UC-One application with the "Simple spy tool" in the UI Automation framework or with Inspect.exe from Windows SDK.

Share this post


Link to post
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