show password characters in a InputBox

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #35766
    minou
    Participant

    hello

    I have an inputbox and would like the user to enter a password, but TEdit or Tsedit not skin

    This is my code so far:

    Code:
    const
    InputBoxMessage = WM_USER + 200;

    private
    procedure InputBoxSetPasswordChar(var Msg: TMessage); message InputBoxMessage;

    procedure TForm1.InputBoxSetPasswordChar(var Msg: TMessage);
    var
    hInputForm, hEdit: 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;

    usage
    PostMessage(Handle, InputBoxMessage, 0, 0);
    pass:=sinputbox('Verify Your Account : ','Password : ','');

    0e51.jpg

    #50619
    Support
    Keymaster

    Thank you for info 🙂

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.