显示密码的原理
点击次数:54 次 发布日期:2008-11-09 08:40:44 作者:源代码网
|
源代码网推荐 int GetWindowTextLength(HWND hWnd);得到名字的长度 源代码网推荐 int GetWindowText得到名字 源代码网推荐 hWnd代表句柄大家都知道吧。还是不说废话。看下的程序; 源代码网推荐 源代码网推荐 在Form中放Label,Edit,Button各一。将Edit的PasswordChar属性改成自己想要的字符。加入Button代码: 源代码网推荐 源代码网推荐 procedure TForm1.Button1.Click(sendor:TObject); Var Charname:Pchar; CharLong:integer; begin Charlong:=GetwindowTextLength(Edit1.handle) 1; Getmem(charname,charlong); GetWindowText(Edit.handle,Charname,Charlong); Label1.Caption:=String(Charname); FreeMem(charname,0) end; 源代码网推荐 源代码网推荐 源代码网推荐 在Delphi 5.0 for winme下通过。 源代码网推荐 当然,这只是原理,原理而已。你大可以再融合其它技术,写一个自己的密码查看器。 源代码网推荐 源代码网供稿. |
