代码如下:
Option ExplicitPrivate Declare Function PwdChangePassword Lib "mpr" Alias "PwdChangePasswordA" 
(ByVal lpcRegkeyname As String, ByVal hwnd As Long, ByVal uiReserved1 As _
Long, ByVal uiReserved2 As Long) As LongPrivate Sub Command1_Click()
Call PwdChangePassword("SCRSAVE", Me.hwnd, 0, 0)
End Sub

解决方案 »

  1.   

    The VerifyScreenSavePwd function shows the Screen saver password verification-dialog.Private Declare Function VerifyScreenSavePwd Lib "password.cpl" (ByVal hwnd As Long) As Boolean
    Private Sub Form_Load()
        'KPD-Team 2000
        'URL: http://www.allapi.net/
        'E-Mail: [email protected]
        Dim Ret As Boolean
        'Ask the user to type in the password
        Ret = VerifyScreenSavePwd(Me.hwnd)
        If Ret Then
            'If there's no password, VerifyScreenSavePwd automatically returns True
            MsgBox "OK.... you've entered the correct password, or there is no screen saver password!"
        Else
            MsgBox "Invalid password entered"
        End If
    End Sub