procedure CheckSignEd(ed: TEdit);
begin
with ed do
if (PasswordChar = '*') and (text <> '') then
begin
try
Text := GetConverted(Text);
PasswordChar := #0; // <--- Here is the problem
except
Text := EmptyStr;
SetFocus;
raise;
end;
end;
end;
The idea is that if you exit 'ed' if it is in password mode, I lookup a
corresponding value (if found) with the GetConverted method (one of my
own!). If GetConverted doesn't find a corresponding value it raises an
exception, otherwise it returns a new value to the editor and I can set
PasswordChar to #0 to show the new value.
The problem is in the PasswordChar := #0 line: PasswordChar doesn't change!
Well, tracking the Borland source code shows it actually does up to a call
to CallWindowProc from a SetTextBuf call in the SetPasswordChar method of
TCustomEdit. So Bill and the boys don't want me to change PasswordChar?
Does anyone have a solution?
/Anders
The method here had a counterpart: in the OnChange of the TEdit I had the
following line:
Edit1.PasswordChar := '*';
with the intention of making any change in the editbox trigger it into
password mode. But of course I have to protect it when i set the converted
text in CheckSignEd!
Thanks to all who gave the problem a thought!
Anders
Try to replace that with
Perform( EM_SETPASSWORDCHAR, 0, 0 );
If it still does not work you have found a new security feature in Windows
(which platform are you using, by the way?).
Peter Below (TeamB) 10011...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
Note: I'm unable to visit the newsgroups every day at the moment,
so be patient if you don't get a reply immediately.
--
David McCallum
dm...@actual-systems.com
davidm...@btinternet.com
www.carparts-uk.com
www.carparts-us.com
www.carparts-nl.com
"Micke" <lord...@hotmail.com> wrote in message news:3c0faef4_2@dnews...