How do you read a string of characters from an edit box and use it in program?

Started by etow, March 27, 2008, 12:39:46 PM

Previous topic - Next topic

etow

Hi

Does anyone know how to read in a string of characters from the edit box in a Windows application created by EasyCode, save the string of characters in a variable.  Then compare the string of characters variable against your desired character string?

For example,  In the Edit box , the user enters  " <= "  and store it in a variable called LessThanEqual
Then compare this string against another other string that you want the program to compare to
lets say the string  " != " then how would you go about doing this?

Thanks

jj2007

invoke SendMessage, hEdit, WM_GETTEXT, sizeof buffer, addr buffer


Rest see below, from \masm32\help\masmlib.chm (amazing how much useful stuff you can find in that folder, isn't it?)

szCmp proc str1:DWORD,str2:DWORD


Description

szCmp compares two zero terminated strings for difference.


Parameters

1. str1 The first string to compare
2. str2 The second string to compare


Return Value

If the two strings match, the return value is the length of the string. If there is no match, the return value is zero.


Comments

The procedure can be used on strings that may be of uneven length as the terminator will produce the mismatch even if the rest of the charactes match.



etow

hi

For the Code:
invoke SendMessage, hEdit, WM_GETTEXT, sizeof buffer, addr buffer

How do you declare buffer?
Is buffer, the array of characters or the string of characters in an array?

Thanks


Ramon Sala

hEdit is the handle to the Edit box. You can get it by calling the GetWindowItem method.
Greetings from Catalonia