This code when run gets the password from a password
window of any application. To try it out use the
following procedure to get the password.
API Description :
Waooooo getting password was
never so easy. Lets dissect the code.
The "GetCursorPos" api gets the current mouse position
on the screen in a structure i.e. the x and y
coordinates on the screen.
The "WindowFromPoint" api gets
the window handle from the x and y coordinates.
The "GetClassName" api gets the
classname of the control on which mouse is placed might
be a "text" or an "edit" control (Password).
The "SendMessage" api sends the
window (of which we are having the handle) , the
control(text or edit) a message where in the password
character is changed from * to nothing (0) . Meaning
that no password char is applicable to the edit box.
Thus the password is exposed.
C# Corner. All contents are copyright of their authors.