CryptoSys PKI Pro Manual

PWD_PromptEx

Prompts for a password in a dialog box with option to change prompt wording.

VBA/VB6 Syntax

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)

C/C++ Syntax

long __stdcall PWD_PromptEx(char *szPassword, long nPwdLen, const char *szCaption, const char *szPrompt, long nOptions);

Parameters

szPassword
[out] to receive the password entered by the user.
nPwdLen
[in] specifying the maximum length of the string to be received.
szCaption
[in] specifying a caption for the dialog box (optional).
szPrompt
[in] specifying the prompt (default="Enter password:").
nOptions
[in] option flags: not used in this release. Specify zero.

Returns (VBA/C)

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.

.NET Equivalent

Pwd.Prompt Method

Python Equivalent

static Pwd.prompt(caption="", prompt="")

Remarks

See PWD_Prompt().

Example

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 = ""

See Also

PWD_Prompt

[Contents] [Index]

[PREV: PWD_Prompt...]   [Contents]   [Index]   
   [NEXT: RNG_Bytes...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.