Thanks. That was just what I needed.
Though the only part of your code that I don't understand is:

***

mov edx, wParam
mov ecx, offset char
@@:
cmp byte ptr,0
lea ecx,
jnz @B
dec ecx

***

I guess that "mov ecx, offset char" puts the new character in the "char" variable.
But what does "mov edx, wParam" do then?

Then comes the loop. How can you make a loop? Do you know any loop tutorials?
I understand what "cmp"(copy byte or something) does(Alittle unclear), but what does "lea" do?
Does "lea" add a number to ecx or what
And why "dec ecx" and not "xor ecx, ecx" or "div ecx, ecx"(Devide) or "sub ecx, ecx"(Subtract)?

I know the code work but I don't know why. Please help me, cause I am :confused:

Julian, the guy who always gets help from you.
Posted on 2003-08-28 07:36:50 by JulianS
mov ecx, offset char is the same as assigning/mov the address of char to ecx.
mov edx, wParam is the moving the parameter(containing the character inputed) passed to the function to edx.
I used lea ecx, which does the same thing as inc ecx *but* without the modification of flags. The flags needs to be preserved for the next conditional jmp.

If you are more intersted in the loop I used, read the following link:
http://www.asmcommunity.net/board/index.php?topic=1133

There is no definition on how a loop should look like. But it is just the repeating thing that gives it the name "loop". No one ever did make the rule that ecx must always be the counter for a loop or something like that.

:grin:
Posted on 2003-08-28 08:27:35 by roticv