Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions devices/ms/Files/common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1497,9 +1497,29 @@ Function GetPasswordBasedCredentials
${NSD_CreateLabel} 10 66u 60u 22u "<?php WindowsCommon::echoNsis(_("Repeat password:"))?>"
${NSD_CreatePassword} 67u 65u 80u 12u "$PASS2"
Pop $PASS2_F

; Adapted from https://nsis.sourceforge.io/NsDialogs_FAQ#How_to_hide.2Fshow_passwords_in_a_Text_Password_control

${NSD_CreateCheckbox} 10 69u 60u 22u "Show password"
Pop $hwnd
${NSD_OnClick} $hwnd ShowPassword

nsDialogs::Show
FunctionEnd

; Show the password
Function ShowPassword
Pop $hwnd
${NSD_GetState} $hwnd $0
ShowWindow $PASS1 ${SW_HIDE}
${If} $0 == 1
SendMessage $PASS1 ${EM_SETPASSWORDCHAR} 0 0
${Else}
SendMessage $PASS1 ${EM_SETPASSWORDCHAR} 42 0
${EndIf}
ShowWindow $PASS1 ${SW_SHOW}
FunctionEnd

; Handle user input
Function SavePasswordBasedCredentials
${NSD_GetText} $UNAME_F $UNAME
Expand Down