I have actually been wondering this for a very long time
WHat precisely is a CLassNN
for instance within Notepad is Edit1 the controls ID
I ask because someone said they have all the id's of controls in an application but they dont want to edit the app instead make an autoinstaller with ahk
Could i take the control ID's from the actual source code of the app and write automation? without ever having the app?

what does ClassNN represent
Started by
tank
, May 30 2009 05:04 PM

Best Answer Lexikos , 31 May 2009 - 03:53 AM
6 replies to this topic
Grab some free C/C++ code from CodeProject or elsewhere and look at resource.h and <project name>.rc (or anything close to that). You'll see controls like IDC_EDIT1, IDC_COMBO1, IDC_SCROLLBAR1, IDB_BITMAP1 and so on in the rc file, while in the header you'll see:
#define IDC_EDIT1 1013
#define IDC_COMBO1 1016
#define IDC_SCROLLBAR1 1018
#define IDB_BITMAP1 129
(values randomly taken from Yuri Goltsman's CFCtrlDemo)
The latter are control IDs while the former are control classes. The class is the "type" of control (Edit/ComboBox/Scrollbar/Bitmap) as the compiler knows it. The ID is an (arguably) arbitrary (incremental) value given by the compiler to each resource, to keep track of them throughout the code.
If I'm wrong, someone please correct me.
#define IDC_EDIT1 1013
#define IDC_COMBO1 1016
#define IDC_SCROLLBAR1 1018
#define IDB_BITMAP1 129
(values randomly taken from Yuri Goltsman's CFCtrlDemo)
The latter are control IDs while the former are control classes. The class is the "type" of control (Edit/ComboBox/Scrollbar/Bitmap) as the compiler knows it. The ID is an (arguably) arbitrary (incremental) value given by the compiler to each resource, to keep track of them throughout the code.
If I'm wrong, someone please correct me.
#2
-
Posted 30 May 2009 - 06:46 PM

✓ Best Answer
window class and the index of the control, which is based on the number of controls of that class found while enumerating. Control identifiers are unfortunately irrelevant, and the window class is not something the compiler is aware of.
Edit1 is the first Edit control. Edit is a system class, and is not directly equivalent to the AutoHotkey Gui control type; for instance, while "Edit" is used by both AutoHotkey and Windows, AutoHotkey's Text and Picture controls both use the system class "Static". This also applies to "class names" in frameworks such as MFC (C++) or Windows Forms (.NET).
ClassNN comes from the (Windows API) Edit1 is the first Edit control. Edit is a system class, and is not directly equivalent to the AutoHotkey Gui control type; for instance, while "Edit" is used by both AutoHotkey and Windows, AutoHotkey's Text and Picture controls both use the system class "Static". This also applies to "class names" in frameworks such as MFC (C++) or Windows Forms (.NET).
Control identifiers can be of some use, but only with some messages (like WM_COMMAND) and Windows API functions. Note that this is only if the application actually uses these (numeric) identifiers with the Windows API. (I think they are set via SetWindowLong.)Could i take the control ID's from the actual source code of the app and write automation? without ever having the app?
#3
-
Posted 31 May 2009 - 03:53 AM

Thank you Lexikos
I knew it would in the end be an answer provided by you or Chris
possibly Sean
lots of reading material for me thanks for the links as well
I knew it would in the end be an answer provided by you or Chris
possibly Sean
lots of reading material for me thanks for the links as well
#4
-
Posted 31 May 2009 - 04:52 AM

Never lose.
WIN or LEARN.
WIN or LEARN.
How can AHK discover a control's identifier?Control identifiers can be of some use, but only with some messages (like WM_COMMAND)
#5
-
Posted 26 August 2009 - 09:39 PM

Possibly:
MsgBox % DllCall("GetWindowLong", "uint", hwnd, "int", GWL_ID:=-12)
#6
-
Posted 27 August 2009 - 12:52 AM

That seems to work. I'll play with it more tomorrow. I should've mentioned I'm working with controls in an AHK Gui, if that makes any difference.
#7
-
Posted 27 August 2009 - 02:55 AM
