Use Screen-Saver Passwords

Use Screen-Saver Passwords

When you write a screen saver in C and the Windows SDK, a static library (SCRNSAVE.lib) allows you to create custom dialogs to change and request the password. But in VB you can’t use this library. If you don’t want to create forms to replace the custom dialogs, use these two undocumented functions:

 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?as a child of hWnd. The two reserved parameters should be zero. VerifyScreen-SavePwd, in password.cpl, pops up a dialog box as a child of hWnd, prompting for the screen saver’s password. If the user gets it wrong, it prints a message saying so and prompts for the password again. If the user presses OK, VerifyScreenSavePwd returns True; if the user presses Cancel, it returns False. These calls?and the DLLs?exist in Windows 95/98 but not in NT because NT handles password management at the system level. Here’s how you can use the PwdChangePassword call:

 Private Sub cmdChange_Click()	PwdChangePassword "SCRSAVE", Me.hWnd, 0, 0End Sub

You must use the string “SCRSAVE” as the first parameter to PwdChangePassword, because it has special meaning and the function fails if another string is passed. Call VerifyScreenSavePwd on detection of mouse or keyboard activity, passing the hWnd the dialog should be owned by. Here’s a simple example of how to test this function:

 Private Sub cmdTest_Click()	Dim bRes As Boolean	bRes = VerifyScreenSavePwd(Me.hWnd)	MsgBox bResEnd Sub
Share the Post:
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

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes

ransomware cyber attack

Why Is Ransomware Such a Major Threat?

One of the most significant cyber threats faced by modern organizations is a ransomware attack. Ransomware attacks have grown in both sophistication and frequency over the past few years, forcing