Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mask password 1

Status
Not open for further replies.

giahan

Programmer
Sep 1, 2000
139
US
Hi,

Is there anyway that i can mask password by asterisk (*) in c++ application (I use visual C++ 6)? (means when I enter my password, it prints out the '*' instead of the letter that I enter from the keyboard)
Please help asap.
Thanks a lot.
GH
 
You mean you want to mask input of a console app?
Greetings,
Rick
 
Yes, from the console.
I think we can't do that.
GH
 
Don't think so either. I think those characters are being echoed before you can read them in. You can try something with hooks though...
Greetings,
Rick
 
Can you be more specific about the hooks???
Thanks
GH
 
Look up the SetWindowsHookEx function in the MSDN. It allows you to hook windows, the keyboard and other things. You might be able to intercept the characters and send dummies to the console this way...
Greetings,
Rick
 
look into the getch function it allows you to read in a character without echoing it to the screen.

-Sean
 
I got it. I use _getch() (located in conio.h) as Sean recommended and works great.
Thanks a lot all.
GH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top