Undocumented dialog box to change screen saver’s password

Undocumented dialog box to change screen saver’s password

When you write a screen saver in C and SDK you can use a static library (SCRNSAVE.LIB) that allows you to create custom dialogs to change and request the password. In VB you can’t access this library, but if you don’t want to create your forms to replace the custom dialogs, you can use a couple of undocumented functions. Unfortunately, these are only available only Windows 95 and 98, but not under Windows NT:

Declare Sub PwdChangePassword Lib "mpr.dll" Alias "PwdChangePasswordA" (ByVal _    lpcRegkeyname As String, ByVal hwnd As Long, ByVal uiReserved1 As Long, _    ByVal uiReserved2 As Long)Declare Function VerifyScreenSavePwd Lib "password.cpl" (ByVal hwnd As Long) As _    Boolean 

PwdChangePassword is in MPR.DLL, the Multiple Provider Router. It does all the password management associated with Regkeyname, including popping up a dialog box (as a child of the window referred to by the hWnd handle). The two reserved arguments should be zero.

VerifyScreenSavePwd is in PASSWORD.CPL. It pops up a dialog box (as child of hWnd) that prompts for the screen saver’s password. If the user enters a wrong password, it prints a message saying so and prompts for it again. If the user presses OK then it returns True; if the user presses Cancel, then it returns False. This is an example of their use:

Private Sub cmdChange_Click()     PwdChangePassword "SCRSAVE", Me.hwnd, 0, 0End Sub Private Sub cmdTest_Click()     Dim bRes As Boolean     bRes = VerifyScreenSavePwd(Me.hwnd)     MsgBox bResEnd Sub 

Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular