Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Locating/Clicking buttons in a Windows Application

  • Please log in to reply
4 replies to this topic
  • Guests
  • Last active:
  • Joined: --
Hello All,

I use iWeb to locate and click buttons on a web page. This works great. Now I have a windows application (no idea what code it was written in, etc) which I need to interact with. It's a simple windows with some buttons in it.

If the window is name TEST WINDOW, would it be possible to WinActivate the window, and have AHK find and click a button in the window?

Let's say the button is named "Info". Or is this simply not possible?

Coordinates are something I was using before with mouseclicks but that is too unreliable.

Thank you.

  • Members
  • 4368 posts
  • Last active: Aug 09 2015 02:36 AM
  • Joined: 26 Dec 2010
You need ControlClick. Use window spy to find the ClassNN of the button.

If you want, my window control tools can help. Specifically controlclickstalk.
[/shameless plug] ;)

  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009
Open "Windows Spy" in the AHk folder, and inspect the button(s)
post the contents of Window Spy.
You need the AHK_class of the window and the ClassNN of the control(s)

  • Guests
  • Last active:
  • Joined: --
Ok I thought I needed to used WindowSpy, when I spy it... I get this:

>>>>>>>>>>( Window Title & Class )<<<<<<<<<<<
Citrix Connection Center
ahk_class #32770

>>>>>>>>>>>>( Mouse Position )<<<<<<<<<<<<<
On Screen:	213, 246  (less often used)
In Active Window:	-299, 33

>>>>>>>>>( Now Under Mouse Cursor )<<<<<<<<

Color:	0xF0F0F0  (Blue=F0 Green=F0 Red=F0)

>>>>>>>>>>( Active Window Position )<<<<<<<<<<
left: 512     top: 213     width: 416     height: 444

>>>>>>>>>>>( Status Bar Text )<<<<<<<<<<

>>>>>>>>>>>( Visible Window Text )<<<<<<<<<<<
&Full Screen
&Log Off
File &Security
&Audio Security
PDA S&ecurity
S&canner Security
ICA connections
1 Server used, 1 Remote Applications

>>>>>>>>>>>( Hidden Window Text )<<<<<<<<<<<

>>>>( TitleMatchMode=slow Visible Text )<<<<

>>>>( TitleMatchMode=slow Hidden Text )<<<<

The button I would be attempting to click is "Log Off"

  • Members
  • 4368 posts
  • Last active: Aug 09 2015 02:36 AM
  • Joined: 26 Dec 2010
Looks to me like you can just send alt+l and be done.
Otherwise, run my controlclickstalk, click the button, and post the reults.