Prompts for a password in a dialog box with option to change prompt wording.
Public Declare Function PWD_PromptEx Lib "diCrPKI.dll"
(ByVal strPassword As String, ByVal nPwdLen As Long, ByVal strCaption As String,
ByVal strPrompt As String, ByVal nOptions As Long) As Long
nRet = PWD_PromptEx(strPassword, nPwdLen, strCaption, strPrompt, nOptions)
long __stdcall PWD_PromptEx(char *szPassword, long nPwdLen, const char *szCaption, const char *szPrompt, long nOptions);
If the user enters a password in the dialog box and clicks "OK", the return value is the length of the password entered in bytes. This could be zero. If the user clicks "Cancel", the return value is -1.
static Pwd.prompt(caption="", prompt="")
See PWD_Prompt()
.
Example of PWD_PromptEx
:
Dim strPassword As String * 511 Dim nLen As Long nLen = PWD_PromptEx(strPassword, Len(strPassword), _ "Demo of PWD_PromptEx", "Type secret phrase:", 0) ' Do something with the password... If nLen > 0 Then Debug.Print "Password entered=" & Left(strPassword, nLen) ElseIf nLen < 0 Then Debug.Print "User cancelled" Else Debug.Print "Empty password entered" End If ' Clean up Call WIPE_String(strPassword, nLen) strPassword = ""