Under Win98, for the password box of other programs, we can use the SendMessage function to get the contents of this password box for the next WM_GETTEXT command in this password box. But since 2000, Microsoft's security awareness seems to be a little stronger. Use this command for normal windows, but it doesn't work for the password box.
There are quite a few similar programs that are obtained by creating a dynamic link library, but it is too much trouble. In fact, we have a simpler approach. That is to give it the next command, remove the properties of its password box, then get its contents, and finally restore the properties of its password box.
{
Item: Win2000 /XP /2003 under asterisk password detector
Author: Huang Tao [email protected]
Date: January 18, 2004
}
unit uPassword;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls; Br>
type
TfrmPassword = class(TForm)
edPassword: TEdit; //Display the password text box
Timer1: TTimer; //Timer
procedure Timer1Timer(Sender: TObject) ;
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmPassword: TfrmPassword;
implementation< Br>
{$R *.dfm}
procedure TfrmPassword.Timer1Timer(Sender: TObject);
var s:pchar;
i,n:integer;
p: Tpoint;h:integer;
c:integer;
begin
getcursorpos(p); //get the position of the current cursor
h:=windowfrompoint(p); //When the cursor to the window handle
n:= getwindowlong (h, GWL_STYLE); //take the window's properties
if (n and $20) <>0 then begin //determine whether it is a password Box
c:=sendMessage(h, EM_GETPASSWORDCHAR,0, 0);
//Get the current character of the password box such as ''*'', etc.
PostMessage(h,EM_SETPASSWORDCHAR,0,0);
//Set the password box character is empty, that is, remove the password attribute of the password box,
//This must use PostMessage, but can not use SendMessage, the latter is invalid
i: = sendmessage(h,WM_GETTEXTLENGTH,0,0);inc(i);
//Get the length of the password string
getmem(s,i); //allocate memory
sendmessage(h,WM_GETTEXT, i, longint (s)); //get the password string
edPassword.Text := s; //put the password into the text box
postMessage (h, EM_SETPASSWORDCHAR, c, 0); //restore The original password attribute
freemem(s); //release memory
end;
end;
end.
This program is in Window Server 2003, Delphi 7.0 Compiled under Enterprise. However, this program is only valid for programs that are not protected, such as QQ ganme, etc., but there is still no way for some programs that prevent it. For example, the password box of QQ2004 Beta is useless. It can be seen that the security of the Win2000/XP/2003 password box is also relative. If you want to be safe, you must find your own way.
First, run on the desktop window space in the taskbar Windows XP, right-click, select Tool
For users who often need to back up files and synchronize files, Allway Sync is rare, although it ca
As the author is increasingly eager to taste the late SP2, and too la
Many people have the experience that when you click on a large AVI type video file
Window xp uses master and rabbit system faster and safer
Not even a trace of difference: XP perfect simulation Vista Raiders (5)
Interpretation of the TMP format file in XP system
Let Windows XP system cleverly "return to life"
Solve the problem that Windows XP cannot log in after upgrading
Win XP search for hidden files in two ways
Experts explain the role and use of the C disk file for you
Rational use of Win XP hardware profiles
NTFS partitions are free to convert
Seven tricks to prevent illegal users from invading Win 2000/XP system
Explain the emergency repair disk under Win2003
Windows 8.1 prompts com surrogate has stopped working solution
5 common faults and solutions under Windows 7
Windows 8 IE10 can not download files solution
How to manually upgrade win7 win10? win7 official upgrade win0 graphic tutorial
Win7 prompts the application to run when opening the software
Quickly use the registry, junk files go without trace
Win7 upgrade sp1 black screen prompt 0xc0000034 how to deal with
Five steps to get XP can not start after installing Win 7
Win10 system how to close the bottom right corner advertising