Please, take a look at this:


_MainWndProc_WM_Create:

push 0
push [hInstance]
push Edit1ID (0)
push dword [esp+4]
push 25
push 200
push 35
push 50
push 050800080h (010800080h - non-Child)
push EditText
push EditClassName
push 0200h
call [CreateWindowEx]
mov [hEdit1],eax


I've tired of thinking what's wrong with this.
CreateWindowEx always returns NULL :( . It works only when I change ID and Style with values from brackets. Look at the attached file: not a handy interface. :)

I guess the answer is simple, but little mistakes are mush more hard to find than big ones.
Posted on 2002-10-24 11:34:37 by longer
Sorry, attach is here.
Posted on 2002-10-24 11:39:55 by longer
It seems to me your are trying to create an edit control, thus it should be a child control.

Hmm.. so that means that you should set the style as WS_CHILD. Furthermore, since it is a child control, I do not think it should have a menu so i think EditID should be 0.
Posted on 2002-10-25 08:03:08 by roticv
Hi, roticv!
If I'm not mistaken, when you create a control the hMenu field becomes an ID of a control. Nevertheless, I tried to push 0 instead of EditID, and it doesn't work.
As for WS_CHILD: 050800080h is the sum of WS_CHILD, WS_VISIBLE, WS_BORDER and ES_AUTOHSCROLL.

Maybe this part of code is not enough. Here is the whole code (a FASM one).
Posted on 2002-10-25 10:10:53 by longer

_MainWndProc_WM_Create:
push 0
push
push 0 ;Edit1ID
push dword ;
push 50


Your offset is wrong using ESP in the push as you have already
modified the stack...

Changing it to something like this should work:

_MainWndProc_WM_Create:
mov ecx, dword
push 0
push
push 0 ;Edit1ID
push ecx ;
push 50
Posted on 2002-10-25 12:11:09 by Graebel
Thanks, Graebel!
Great thanks!
I tried to find the mistake everywhere except this string.
Now everything works fine. :alright: :alright: :alright:
Posted on 2002-10-25 12:23:00 by longer