Hi,

how can I detect, if a control is an edit, multiedit or richtextedit ?
I tried to detective it via GetClassName, if the string contains the text "EDIT".
But that technic seems not to be very sure, because Delphi-Programm ect. use their own classes...
Does anybody know a better way ?

Greetings,
Nordwind64
Posted on 2003-06-27 06:53:16 by Nordwind64
Maybe compare the module name just to be sure. I think Edit is in user32.dll, and Rich Edit is in Riched32.dll, or Riched20.dll.

Something like:

[size=12]invoke GetWindowLong, hwnd, GWL_HINSTANCE

invoke GetModuleFileName, eax, addr buffer, MAX_PATH
invoke FileNameFromPath, addr buffer
mov modfilename, eax
invoke lstrcmpi, modfilename, addr richeditDLLname
or eax, eax
jz @match
invoke lstrcmpi, modfilename, addr editDLLname
or eax, eax
jz @match[/size]
Posted on 2003-06-27 07:19:50 by iblis
Thanks, iblis.

Ok, but Buttons, Listboxes ect. have module name USER32.DLL, too.....
Posted on 2003-06-27 08:10:11 by Nordwind64
Well this is *after* you compare the class name. The module name check is the second test just to be sure.
Posted on 2003-06-27 10:56:03 by iblis
Hmm, but the test isn't sure, too.
Nearly 90% of the controls base on User32.dll

Greetings,
Nordwind64
Posted on 2003-06-27 13:08:55 by Nordwind64
Norwind, if you see a control with the class name "EDIT", and that control's module is %system%\user32.dll, then it's an edit control. You can be certain.
Posted on 2003-06-27 14:39:11 by iblis
Hi,

ok, iblis !
Thanks alot.

Greetings,
Nordwind64
Posted on 2003-06-28 01:04:33 by Nordwind64