时间: 2021-07-31 作者:daque
大师都用过用来表露暗号的东西吧,嘿嘿。本来道理很大略.比方说在delphi中,edit控件的passwordchar属性可让框中的回显的字符为本人想要的字符。然而那些字符对于里面来说是静止的(虽说不够专科,但即是这么回事)!!而咱们宏大的delphi给了这个api---- 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下经过。 固然,这不过道理,道理罢了。你大不妨再融洽其它本领,写一个本人的暗号察看器。