 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
scamper_22
Joined: 15 May 2009 Posts: 12
|
Posted: Thu Nov 12, 2009 11:26 pm Post subject: help finding classID of window |
|
|
Hi all,
I have this external application that I am trying to insert some text into an edit box.
So I am using 'ControlSetText'.
I am trying to find the ClassNN (the classname and instance number of the control).
Now, I did manage to get it to work just by trying out Edit0, Edit1, Edit2.... Edit9... trial and error
Eventually I got the edit box I wanted
ControlSetText, Edit9, Some new text, Window Title
But there must be someway to find out that it is Edit9 without trial and error.
I tried both spy++ that came with vs6 as well as a program called winspector. I looked through all the listed properties and while I could find the class name was 'Edit' Nowhere was this 9 to be found.
Winspector gave this info:
-------------------
Class Name Edit
Text Some Indentifying text
Rectangle 882, 714, 1155, 734
Size 273, 20
Client Rectangle 0, 0, 269, 16
Client Size 269, 16
Styles
WS_CHILD
WS_VISIBLE
WS_TABSTOP
ES_LEFT
ES_AUTOHSCROLL
StylesEx
WS_EX_NOPARENTNOTIFY
WS_EX_CLIENTEDGE
WS_EX_LEFT
WS_EX_LTRREADING
WS_EX_RIGHTSCROLLBAR
ID
1008
Properties
Atom: #43288 0xFFFFFFFF (-1)
Class specific
Window is Ansi
Owner EXE
C:\Program Files\XXYYZZ
-------------------
Under Spy++, the following identifiers are there:
General: Instance Handle: 00400000
Control ID: 3F0 (same as above 1008 decimal)
Class: Instance Handle: 0
Class Atom: C018
-------------------------
basically, no where do i see a '9'.
Any ideas here? |
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 2926 Location: The Shell
|
|
| Back to top |
|
 |
Leef_me
Joined: 08 Apr 2009 Posts: 5336 Location: San Diego, California
|
Posted: Fri Nov 13, 2009 12:40 am Post subject: |
|
|
for comparison AU3_Spy reports this for a new Notepad app & file
| Quote: | >>>>>>>>>>( Window Title & Class )<<<<<<<<<<<
Untitled - Notepad
ahk_class Notepad |
|
|
| Back to top |
|
 |
scamper_22
Joined: 15 May 2009 Posts: 12
|
Posted: Fri Nov 13, 2009 12:45 am Post subject: |
|
|
argh... wouldn't u know it.., AU3_Spy gives me Edit9.
thanks guys. We only copy the autohotkey exec, so I forgot about the au4_spy program. Thanks for the remineder. |
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 2926 Location: The Shell
|
Posted: Fri Nov 13, 2009 2:09 am Post subject: |
|
|
You can also type some text into the edit box and run this:
| Code: | WinGet, ctrlList, ControlList, A
Loop, Parse, ctrlList, `n
{
ControlGetText, ctrlTxt, % A_LoopField, A
If !ctrlTxt
{
MsgBox, 4,, % "Control for Active Window is: " A_LoopField "`n`nContinue?"
}
Else
{
MsgBox, 4,, % "Control for Active Window is: " A_LoopField "`n`nControl's Text is:`n`n" ctrlTxt "`n`nContinue?"
}
IfMsgBox, No
Break
} |
 _________________
paradigm.shift:=(•_•)┌П┐RTFM||^.*∞ |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|