Jump to content
Sign in to follow this  
Witmarquzot

Getting win info from ID

Recommended Posts

Witmarquzot

Is there a way to get window position using the window ID, such as

WinGetPos([iD:1383830])

Share this post


Link to post
Share on other sites
water

AutoIt is designed to work perfectly with windows and controls. So no need to get the window position if you want to automate an application.

Can you please describe what you want to do? Maybe there is a better way to do what you want.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
jdelaney

Seems like the ID would be associated with a control...not a window. I suppose you can get all windows, and then loop through them to see which one has that control id (could be several, could be none), and then get the position of the window, conditionally

Try this, else tell us what you need

$iControl = 1383830
$aWin = WinList ()
For $i = 1 to UBound($aWin)-1
 If StringLen($aWin[$i][0])>0 Then
  $hControl = ControlGetHandle($aWin[$i][1], "", $iControl)
  If IsHWnd($hControl) Then
   $array = WinGetPos($aWin[$i][1])
   _ArrayDisplay($array)
  EndIf
 EndIf
Next
Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites
Witmarquzot

Setting up a smoke test for an application written in .net

As so the classes are as so [WindowsForms10.window.8.app.0.29e8405]

and the children windows are not set up to be activated

so I need to be able to move the mouse in position based on the window location on the screen. I can not get it to always grable the handle of the window I am interested in. There is a very good chance that I am at the end of my good thinking wits and way over thinking this and missing something simple.

So right now it keeps grabbing the position/handle of the main window, but I need the postion of the control window. Instance changes and for some reason

WinGetPos("[NAME:DataGridView1]") does not work.

>>> Window <<<<

Title: Route Manager - Stark Industries

Class: WindowsForms10.window.8.app.0.29e8405

Position: -8, -8

Size: 1382, 754

Style: 0x17CF0000

ExStyle: 0x00050100

Handle: 0x00000000002307F8

>>>> Control <<<<

Class: WindowsForms10.window.8.app.0.29e8405

Instance: 14

ClassnameNN: WindowsForms10.window.8.app.0.29e840514

Name: DataGridView1

Advanced (Class): [NAME:DataGridView1]

ID: 4267914

Text:

Position: 265, 96

Size: 1095, 579

ControlClick Coords: 435, 88

Style: 0x56010000

ExStyle: 0x00000000

Handle: 0x0000000000411F8A

>>>> Mouse <<<<

Position: 708, 215

Cursor ID: 0

Color: 0xFFFFFF

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

ToolStrip1

ToolStrip1

BindingNavigator1

Active Only

Inventory List

MenuStrip1

Share this post


Link to post
Share on other sites
water

WindowsForms applications are hard to automate.

Never done it myself but IIRC there are a lot of threads about this subject on the forum. Search for "windows forms" and you will get a lot of hits.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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
Sign in to follow this  

×