Jump to content

Recommended Posts

Posted

Hello,

I have to click a static text which is on a windows gui application (built on c#), click takes to another window. Tried with ControlClick() and with MouseClick() after getting the x & y coordinates using ControlGetPos(), but no luck :-( am clueless how to do static text clicks.

Plz. find the below summary for Window and Control, which I should click

>>>> Window <<<<

Title: ScanWindow

Class: WindowsForms10.window.8.app.0.201d787

Position: 379, 6

Size: 650, 411

Style: 0x1EC80000

ExStyle: 0x00050500

Handle: 0x0002050C

>>>> Control <<<<

Class: WindowsForms10.STATIC.app.0.201d787

Instance: 2

ClassnameNN: WindowsForms10.STATIC.app.0.201d7872

Advanced (Class): [CLASS:WindowsForms10.STATIC.app.0.201d787; INSTANCE:2]

ID: 459988

Text: Edit

Position: 557, 133

Size: 25, 15

ControlClick Coords: 17, 7

Style: 0x5601000D

ExStyle: 0x00000000

Handle: 0x000704D4

Thoughts/workarounds/suggestion are highly appreciated.

Thanks in Advance

Regards,

--AK.

Posted

ControlClick(HWnd(0x0002050C),"","[CLASS:WindowsForms10.STATIC.app.0.201d787; INSTANCE:2]")

Since the handle will change, you can change the first parameter to either the window title ("ScanWindow") or it's classname: "[CLASS:WindowsForms10.window.8.app.0.201d787]"

Posted

ControlClick(HWnd(0x0002050C),"","[CLASS:WindowsForms10.STATIC.app.0.201d787; INSTANCE:2]")

Since the handle will change, you can change the first parameter to either the window title ("ScanWindow") or it's classname: "[CLASS:WindowsForms10.window.8.app.0.201d787]"

Thanks for your quick reply. Tried but no luck :-)

Any more thoughts???

Posted

Try this:

$hWND = WinGetHandle ("ScanWindow")
$hControl = ControlGetHandle ($hWND, "", "[CLASS:WindowsForms10.STATIC.app.0.201d787; INSTANCE:2]")

$ret = ControlClick ($hWND, "", $hControl)
MsgBox (0, "", $ret)

I'm not entirely sure if what is returned by AutoIt window is correct. Are you sure you're getting the right things from the window?

Cheers,

Brett

Posted

Try this:

$hWND = WinGetHandle ("ScanWindow")
$hControl = ControlGetHandle ($hWND, "", "[CLASS:WindowsForms10.STATIC.app.0.201d787; INSTANCE:2]")

$ret = ControlClick ($hWND, "", $hControl)
MsgBox (0, "", $ret)

I'm not entirely sure if what is returned by AutoIt window is correct. Are you sure you're getting the right things from the window?

Cheers,

Brett

$ret = ControlClick ($hWND, "", $hControl), does return 1 - success, whereas it does not simulate click event on the linked text (Edit)

Any more thoughts???

Regards,

--AK

  • 4 months later...
Posted (edited)

I get the same trouble, who can help me?

Thanks in Advance.

The Window and Contrl info as below:

>>>> Window <<<<

Title: ImageViewer

Class: #32770

Position: 64, 35

Size: 1026, 872

Style: 0x94CA00C4

ExStyle: 0x00050111

Handle: 0x00180722

>>>> Control <<<<

Class: Static

Instance: 7

ClassnameNN: Static7

Advanced (Class): [CLASS:Static; INSTANCE:7]

ID: 1033

Text:

Position: 249, 645

Size: 162, 162

ControlClick Coords: 50, 61

Style: 0x5000100E

ExStyle: 0x00020004

Handle: 0x0009073A

Edited by Shibin
  • 1 year later...

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