An OLD favorite Confusion: Class NN and still foggy!

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
iilabs
Posts: 296
Joined: 07 Jun 2020, 16:57

An OLD favorite Confusion: Class NN and still foggy!

Post by iilabs » 24 Jun 2023, 17:25

Hello AHK aficionados,

I'm back to an old blunder Ive never figured out how to deal with Class NN?, I'm trying to activate some GUI buttons and fields in a 3rd party program and avoiding mouse moves, delays, clicks, etc. I'll be using this repetitively for building other variables.

Any ideas how I can streamline the current code? This is how the GUI appears after pressing F7.
I'm trying to engage the Class NN and ahk_class as detailed in the png.
However, I cant seem to activate and likely missing some key steps. Maybe there is another way to skin this nasty cat?

[/code]
ClassNN.png
ClassNN.png (34.71 KiB) Viewed 328 times

Code: Select all

; For testing  Copy and pasting 
;ClassNN:	EPListWnd1
;ClassNN:	eRADTextInputWindow1
;ahk_class EPFloatingWindow
;ClassNN:	eRADButtonWindow3 ;Copy to clipboard button
;ClassNN:	eRADButtonWindow1  ;close button

Code: Select all

F11::
BlockInput, MouseMove
Send, {F7}  ;USED in Program to load the GUI
Sleep, 200
WinGetPos, X, Y,,, ahk_class EPFloatingWindow ;This is the ahk_class for the floating window I want. 
Coordmode, Mouse, Screen
Click, % X + 100 "," Y + 63
sleep, 50
Sendinput, (0028,0030)  ;This is the Pixel Spacing filed I want to eventually copy data to clipboard.
Sleep, 550
Click, % X + 124 "," Y + 132
sleep, 50
Click, % X + 250 "," Y + 420
Sleep, 550
PS := Clipboard
PixelSpace := SubStr(PS,27,8)
Tooltip, % PixelSpace
SetTimer, RemoveToolTip, -1000
Click, % X + 720 "," Y + 11  ;Click X box to close
BlockInput, MouseMoveOff
Return
Last edited by iilabs on 25 Jun 2023, 14:38, edited 4 times in total.

User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: An OLD favorite Confusion: Class NN and still foggy!

Post by mikeyww » 24 Jun 2023, 18:18

You can run this test script that shows you how to use :arrow: ControlClick, but this is a button rather than text. The documentation shows how to activate controls, too. See Control and ControlFocus.

Code: Select all

#Requires AutoHotkey v1.1.33
winTitle := "ahk_class AutoHotkeyGUI"
classNN  := "Button1"
showDummyGui()

F3::ControlClick % classNN, % winTitle

showDummyGui() {
 Gui Font, s10
 Gui Add, Button, w230, Test
 Gui Show, x200
}

buttonTest() {
 MsgBox 64, Success, 123
}

User avatar
iilabs
Posts: 296
Joined: 07 Jun 2020, 16:57

Re: An OLD favorite Confusion: Class NN and still foggy!

Post by iilabs » 24 Jun 2023, 22:26

That worked great :thumbup: . Only one that didnt work was:
ClassNN: EPListWnd1

Somehow did get a focus? Maybe it’s not a button but a list that needs to be clicked to activate? Any clue? It’s the only one requiring mouse movement and click so I can live with it. Just curious as to why it didn't work but rest did. At least that was awesome.

Thanks again as always, mikeyww!

User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: An OLD favorite Confusion: Class NN and still foggy!

Post by mikeyww » 25 Jun 2023, 05:16

The name suggests a non-button-- perhaps a list of some type-- but I do not know anything more.

User avatar
iilabs
Posts: 296
Joined: 07 Jun 2020, 16:57

Re: An OLD favorite Confusion: Class NN and still foggy!

Post by iilabs » 25 Jun 2023, 09:49

Is there a way to engage it other than control click? Using com? Of DLL?
Last edited by iilabs on 25 Jun 2023, 13:16, edited 1 time in total.

User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: An OLD favorite Confusion: Class NN and still foggy!

Post by mikeyww » 25 Jun 2023, 10:41

Not sure, though you can try the Control command.

UI Automation is another approach.

User avatar
iilabs
Posts: 296
Joined: 07 Jun 2020, 16:57

Re: An OLD favorite Confusion: Class NN and still foggy!

Post by iilabs » 25 Jun 2023, 14:29

So I tried several commands without luck. Can you point me in the right direction for the UI automation. Is this a seperate class I need to download and include in my script?


Post Reply

Return to “Ask for Help (v1)”