完整解决方案,连Win2000下的密码都跑不掉.自己加上那几个控件.使用时拖拉lblChk这个<br>label就行了.<br>procedure TFrmAbout.lblChkMouseDown(Sender: TObject; Button: TMouseButton;<br> Shift: TShiftState; X, Y: Integer);<br>begin<br> if (Button=mbLeft) and (ssLeft in Shift) then<br> begin<br> Screen.Cursor:=crDrag;<br> lblPass.Caption:='ready';<br> end;<br>end;<br><br>procedure TFrmAbout.lblChkMouseUp(Sender: TObject; Button: TMouseButton;<br> Shift: TShiftState; X, Y: Integer);<br>begin<br> Screen.Cursor:=crDefault;<br> lblPass.caption:=GetPassword;<br> lblPass.Hint:=lblPass.Caption;<br>end;<br><br>function TFrmAbout.GetPassWord: string;<br>var p:TPoint;<br> hWnd,PassChar:integer;<br> buf:array[0..1023] of char;<br>begin<br> GetCursorPos(p);<br> hWnd:=WindowFromPoint(p);<br> if hWnd<>0 then<br> begin<br> PassChar:=SendMessage(hWnd,EM_GetPasswordChar,0,0);<br> if PassChar<>0 then<br> begin<br> PostMessage(hWnd,EM_SetPasswordChar,0,0);<br> Sleep(50);<br> SendMessage(hWnd,WM_GetText,1023,Integer(@buf[0]));<br> SendMessage(hWnd,EM_SetPasswordChar,wparam(PassChar),0);<br> end else<br> SendMessage(hWnd,WM_GetText,1023,Integer(@buf[0]));<br> end;<br> Result:=string(Buf);<br>end;