How to make the input by the user to appear as "*" and not the actual letters (it is a password input). And how to read the entered value.
Note: This is a 16 bit DOS application.
Thanks!!
Printable View
How to make the input by the user to appear as "*" and not the actual letters (it is a password input). And how to read the entered value.
Note: This is a 16 bit DOS application.
Thanks!!
I don't have a 16-bit compiler so I can't code anything up, but what about just hooking the keyboard?
I never programmed in 16 bit enviroments (DOS). SO could you explain how to hook the keyboard.
I wrote this for a password program.
Code:void GetPass(char *input, int length, char output)
{
char temp;
for(int i = 0; i < length;)
{
temp = getch();
if(temp == 13 && i > 0)
{
input[i] = 0;
break;
}
if(i > 0)
{
if(temp == 8)
{
putchar(8);
putchar(' ');
putchar(8);
input[--i] = 0;
}
}
if(temp != 8 && temp != 13)
{
putchar(output);
input[i] = temp;
i++;
}
}
}
Vlatko, where did you get your 16b DOS compiler? I would be very interested in it.
Thanks Chimpface i'll give it a try.
The compiler is Turbo C++ 3.0. I have it on a CD i bought yesterday along with other 16 and 32 bit compilers.
I would send it but i am on 33600bps and the TC++ 3.0 is 12MB so..
TC3 is 16b?
Cool, I've got that :D