Jump to content

Recommended Posts

Posted

Hello all,

I have been trying to get a control click working on dwg trueview. I am used to having and ID as a reference but I cannot seem to get this to work, any ideas?

autoit info view

Window
title: Autodesk DWG TrueView 2018 - [5327TB00E1.dwg]
Class: AfxMDIFrame140u
 

Control:
Class: HwndWrapper[DefaultDomain;;30b75a72-7120-4bbd-9e80-4db45a0bf288]
Instance: 1

Control view:
Class: HwndWrapper[DefaultDomain;;30b75a72-7120-4bbd-9e80-4db45a0bf288]
ClassnameNN: HwndWrapper[DefaultDomain;;30b75a72-7120-4bbd-9e80-4db45a0bf288]1
Advanced: [CLASS:HwndWrapper[DefaultDomain;;30b75a72-7120-4bbd-9e80-4db45a0bf288]; INSTANCE:1]
ID:
Text: StatusBar Host

 

 

I have tried:
ControlClick("Autodesk DWG TrueView 2018 - [5327TB00E1.dwg]","StatusBar Host","HwndWrapper[DefaultDomain;;30b75a72-7120-4bbd-9e80-4db45a0bf288]","left" , 1 , 100 , 9 )

ControlClick("Autodesk DWG TrueView 2018 - [5327TB00E1.dwg]","","HwndWrapper[DefaultDomain;;30b75a72-7120-4bbd-9e80-4db45a0bf288]","left" , 1 , 100 , 9 )

 

Any suggestions on how I can get this to click a different layout?

 

Posted (edited)

when you poast code can you please use the code tags in the bar above where you put your post text, it looks like this <>, paste code inside that popup and insert it to your post so others can compile and test and possibly give you solutions. Thanks. Try this

ControlClick("Autodesk DWG TrueView 2018 - [5327TB00E1.dwg]","","[CLASS:HwndWrapper[DefaultDomain;;30b75a72-7120-4bbd-9e80-4db45a0bf288]; INSTANCE: 1]","left" , 1 , 100 , 9 )

use the help

https://www.autoitscript.com/autoit3/docs/intro/controls.htm

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Posted
3 hours ago, Earthshine said:

when you poast code can you please use the code tags in the bar above where you put your post text, it looks like this <>, paste code inside that popup and insert it to your post so others can compile and test and possibly give you solutions. Thanks. Try this

ControlClick("Autodesk DWG TrueView 2018 - [5327TB00E1.dwg]","","[CLASS:HwndWrapper[DefaultDomain;;30b75a72-7120-4bbd-9e80-4db45a0bf288]; INSTANCE: 1]","left" , 1 , 100 , 9 )

use the help

https://www.autoitscript.com/autoit3/docs/intro/controls.htm

autoit info view + program

I have attached an updated image, with the selection I am trying to work with. the red star indicates where the mouse was taking the autoit info from.
 

Opt("WinTitleMatchMode",2)
WinActivate("Autodesk DWG TrueView 2018")
sleep(100)
ControlClick ( "Autodesk DWG TrueView 2018", "StatusBar Host", "", "left" , 1 , 100 , 9 )
sleep(1000)
ControlClick ( "Autodesk DWG TrueView 2018", "", "[CLASS:HwndWrapper[DefaultDomain;;30b75a72-7120-4bbd-9e80-4db45a0bf288]; INSTANCE:1]", "left" , 10 , 100 , 9 )

I have tried both of these approaches and a few other combinations, neither seem to click the tab. I added extra clicks just to see if that was the issue.

 

#include <MsgBoxConstants.au3>

Example()

Func Example()
    Opt("WinTitleMatchMode",2)
    Local $hWnd = WinWait("Autodesk DWG TrueView 2018", "", 10)
    Local $hControl = ControlGetHandle($hWnd, "", "StatusBar Host")
    MsgBox($MB_SYSTEMMODAL, "", "The handle of StatusBar Host is: " & $hControl)
EndFunc   ;==>Example

Taking the stock example and modifying, I got this to return the hardware id but I cannot really click on the button from that alone. and not sure how I would call it with a control click as there does not appear to be a reference for handle items on control click. I am also trying to avoid specific classes because they change when the program closes.
 

Posted (edited)

you may not be able to automate AutoDesk's tools with plain AutoIt. however

 

look at the help, if you have the window handle use that in controlclick

https://www.autoitscript.com/autoit3/docs/functions/ControlClick.htm

Example()

Func Example()
    Opt("WinTitleMatchMode",2)
    Local $hWnd = WinWait("Autodesk DWG TrueView 2018", "", 10)
    Local $hControl = ControlGetHandle($hWnd, "", "StatusBar Host")
    ControlClick (&hWnd, "", "StatusBar Host")
    MsgBox($MB_SYSTEMMODAL, "", "The handle of StatusBar Host is: " & $hControl)
EndFunc   ;==>Example

 

Edited by Earthshine

My resources are limited. You must ask the right questions

 

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