Link to home
Start Free TrialLog in
Avatar of pr2501
pr2501

asked on

password mesage box

With code below i work  with one password.

How should i changeit  to make it work with more passwords?
//// password
procedure tform2.controlpassword();
begin
  ThePassword:=('xyz');  //my  password
  if   richeditWriteOKpassword then
   //  nothing
  else begin
      PostMessage(Handle, InputBoxMessage, 0, 0);
      If InputBox('set editing','Password:','')=(ThePassword)
                Then  begin
     // richedit1.ReadOnly:=false;
      combobox1.Enabled:=true;
      combobox2.Enabled:=true;
      richeditWriteOKpassword:=true;
      richedit1.color:=clwhite;
        end;
    end;
end;
 
// *******************  pasword
procedure TForm2.InputBoxSetPasswordChar(var Msg: TMessage);
var
  hInputForm, hEdit, hButton: HWND;
 begin
  hInputForm := Screen.Forms[0].Handle;
  if (hInputForm <> 0) then
  begin
      hEdit := FindWindowEx(hInputForm, 0, 'TEdit', nil);
               // Change button text:
      hButton := FindWindowEx(hInputForm, 0, 'TButton', nil);
      SendMessage(hButton, WM_SETTEXT, 0, Integer(PChar('Cancel')));
      SendMessage(hEdit, EM_SETPASSWORDCHAR, Ord('*'), 0);
  end;
end;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Geert G
Geert G
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pr2501
pr2501

ASKER

thank you