I am having problems finding a handle to 2 Edit Boxes in an application. They do not have a resource ID that I can extract by using a Resource Editor.


So, I think I am stuck with using EnumChildWindows (I think).


Here is my code:




.486 ; create 32 bit code
.model flat, stdcall ; 32 bit memory model
option casemap :none ; case sensitive

include \masm32\include\windows.inc
include \masm32\include\masm32.inc
include \masm32\include\gdi32.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\Comctl32.inc
include \masm32\include\comdlg32.inc
include \masm32\include\shell32.inc
include \masm32\include\oleaut32.inc

includelib \masm32\lib\masm32.lib
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\Comctl32.lib
includelib \masm32\lib\comdlg32.lib
includelib \masm32\lib\shell32.lib
includelib \masm32\lib\oleaut32.lib

EnmProc PROTO :DWORD,:DWORD

.data

; Title of Window(s)
appName db "Enum Child Windows Example",0
targetName db "PDBilling",0
buffer db 128 dup(0)
notFound db "Application Not Running",0
szEdit db "Edit",0


.data?


.code

start:

invoke FindWindow, NULL, ADDR targetName
.IF eax != NULL
invoke EnumChildWindows, eax, ADDR EnmProc, 0
.ELSE
invoke MessageBox, NULL, ADDR notFound, ADDR appName, MB_OK
.ENDIF


invoke ExitProcess, 0

EnmProc proc eHandle :DWORD, y :DWORD

;------------------------------------------
; For Every Child Window (Control) Found...
;------------------------------------------

; THIS IS WHERE I AM STUCK! HOW DO I FIND
; THE FIRST EDIT BOX CLASS, SAVE THE HANDLE TO
; szEDIT1, and the same for the SECOND one?
;
; I would like to compare the ChildWindows Control Type
; to my szEdit variable. If its Edit #1, save it to a var and so forth.

ret

EnmProc endp

end start





Any advice as what to do next?

Thanks!

Trope
Posted on 2005-03-08 16:17:08 by TropE
Hi, TropE

Some sources with EnumChildWindows:

http://www.geocities.com/xmemor/2lz/antiren_asm.zip
(spy on Editboxes, 2kb)

http://www.geocities.com/xmemor/2lz/wintreesnap.zip
(full current window tree, 7kb)

something else -
http://www.geocities.com/xmemor/2lz/tinyasm.html

Hope it'll help you.
Posted on 2005-03-10 15:43:01 by kero