AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

help finding classID of window

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
scamper_22



Joined: 15 May 2009
Posts: 12

PostPosted: Thu Nov 12, 2009 11:26 pm    Post subject: help finding classID of window Reply with quote

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
View user's profile Send private message
TLM



Joined: 21 Aug 2006
Posts: 2926
Location: The Shell

PostPosted: Fri Nov 13, 2009 12:02 am    Post subject: Reply with quote

What did AU3_Spy (that comes with autohotkey) give you?
_________________
paradigm.shift:=(•_•)┌П┐RTFM||^.*∞
Back to top
View user's profile Send private message
Leef_me



Joined: 08 Apr 2009
Posts: 5336
Location: San Diego, California

PostPosted: Fri Nov 13, 2009 12:40 am    Post subject: Reply with quote

for comparison AU3_Spy reports this for a new Notepad app & file
Quote:
>>>>>>>>>>( Window Title & Class )<<<<<<<<<<<
Untitled - Notepad
ahk_class Notepad
Back to top
View user's profile Send private message
scamper_22



Joined: 15 May 2009
Posts: 12

PostPosted: Fri Nov 13, 2009 12:45 am    Post subject: Reply with quote

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
View user's profile Send private message
TLM



Joined: 21 Aug 2006
Posts: 2926
Location: The Shell

PostPosted: Fri Nov 13, 2009 2:09 am    Post subject: Reply with quote

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
    }

Wink
_________________
paradigm.shift:=(•_•)┌П┐RTFM||^.*∞
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group