eerrr .. a simple window + two edit controls (created using CreateWindowEx ... using EDIT class) :

.DATA
szEditClass db 'EDIT',0

.CODE
start:

...
mov hWnd,eax
...


WM_CREATE:

invoke CreateWindowEx,WS_EX_STATICEDGE,ADDR szEditClass,\
NULL, WS_VISIBLE+WS_CHILD+WS_VSCROLL+ES_READONLY+ES_AUTOVSCROLL+ES_MULTILINE,\
0,0,0,0,hWnd,0,hInstance,NULL
mov hwndEdit,eax

....

invoke GetDlgItem,hWnd,hEdit
mov EditID,eax <- return 0 (error) (cant find control identifier)

invoke GetDlgItem,hWnd,hEdit2
mov EditID2,eax <- return 0 (error) (cant find resource identifier)



I use this in other program and works ok ...
Posted on 2002-08-12 09:09:58 by hunter
The other code it worked on.... Was it done using a resource script?

hMenu part of create Window specifies this value, in your code you've done below, the value is zero!

try:
invoke CreateWindowEx,WS_EX_STATICEDGE,ADDR szEditClass, NULL, \ WS_VISIBLE+WS_CHILD+WS_VSCROLL+ES_READONLY+ES_AUTOVSCROLL+ES_MULTILINE, \
0,0,0,0,hWnd,1,hInstance,NULL

Of course this value should be unique for all children. So you'll need it to be 2 for Edit2...

Mirno
Posted on 2002-08-12 09:26:27 by Mirno
it works X)

invoke GetDlgItem,1,hEdit

invoke GetDlgItem,2,hEdit2
Posted on 2002-08-12 09:40:31 by hunter