Could someone tell me how to COMPARE the content in two edit boxes with a single line of text in each box. Both edit boxes are on the same dialog. If the content match... DO SOMETHING if they don't match DO SOMETHING ELSE.
Posted on 2001-10-17 18:51:49 by cmax
Hi cmax

Copy content of edit box to a buffer using WM_GETTEXT.
Use lstrcmp to compare the buffer to your string.

Posted on 2001-10-17 19:05:07 by KetilO
Hey KetilO

The problem is that I have never seem a lstrcpy routine. The only thing I founded in the masm32 Package is stuff like lstrcat and others. I tried to find it using key word lstrcmp on the Board but there nothing about it. Do you or someone have something that I can use.
Posted on 2001-10-17 19:46:13 by cmax
Hi cmax

MyString db "This is a test string",0
MyBuffer db 256 dup(0)


;Copy text to buffer
invoke SendDlgItemMessage,hWin,IDC_EDIT1,WM_GETTEXT,256,addr MyBuffer
invoke lstrcmp,addr MyString,addr MyBuffer
;Returns eax=0 if equal

Thats it

Posted on 2001-10-17 20:07:49 by KetilO
It might seem small to you but is a big thing to me and others who don't know . . . . . I O U big time.
Posted on 2001-10-17 21:08:46 by cmax
In this example, how would our friend cmax copy the contents of the buffer to another variable? Furthermore, how should this variable be declared? Thanks for puttin up with the newbies :tongue:
Posted on 2001-10-17 22:26:07 by lackluster
Hi cmax,

try something like this:

strlen is in ecx (easy to get in asm, just use scasb and not ecx)
this way no api required

mov edi,offset mybuf
repne cmpsb
or ecx,00
jz @success
Posted on 2001-10-17 22:31:34 by czDrillard
There is the jecxz instruction, too. That would get rid of the or instruction:
	mov al,0 ;look for a null

mov edi,String1
or ecx,-1 ;couple bytes better than 'mov ecx,-1'
repne scasb ;find zero byte from edi
not ecx ;length of String1

mov edi,String1
mov esi,String2
repe cmpsb
jecxz @Success
Isn't it possible for this to @Succeed with the last byte being different - must test it out?
Posted on 2001-10-17 23:11:01 by bitRAKE