Hi! I want to get text from EditBox #1 and I write the following code.
invoke    GetWindowTextA, ID_NAME, ADDR NameBuffer, 60
     .IF  EAX == 0
          invoke    MessageBoxA, hWnd, ADDR Error, ADDR AppName, MB_OK
Whether I enter a text or not in the EditBox, it show error message. How do I retrieve text from Edit Box? I used CreateWindowExA to create editbox instead of a using Dialog Box. Thanks
Posted on 2001-05-31 10:02:00 by e-nigma
When you use CreateWindowEx, record the result some where, it is the handle to the window (in this case Edit box) you just created.

invoke CreateWindowEx, WS_EX_CLIENTEDGE,\
       ADDR EditClass, NULL,\
       WS_CHILD or WS_VISIBLE or WS_VSCROLL or \
       ES_LEFT or ES_MULTILINE,\
       0, 0, 0, 0,\
       hWnd, NULL, hInstance, NULL
mov hEdit, eax
Then use this handle in the GetWindowText call:
invoke GetWindowText, hEdit, ADDR MyBuffer, 60
In your code below, you seem to be using some constant, rather than the handle to this window. Mirno
Posted on 2001-05-31 10:27:00 by Mirno
if you're using a Dialog resource and trying to get the text from a dialog item, use GetDlgItemText
Posted on 2001-05-31 15:46:00 by Sloat