Solved

MFC Screen Savers and Password Protection

Posted on 1997-08-01
10
330 Views
Last Modified: 2013-12-03
I am trying to convert one of my old Windows 3.1 screen savers to MFC. I am using MS Visual C/C++ Developer Studio v4.0 and understand the sample screen saver "SAVER" provided with the CD.

My question is this: What do I need to do to make it password protected? I would like a simple piece of code showing me how to add the code to handle passwords in an MFC Windows 95 screen saver.
0
Comment
Question by:Palmerj
10 Comments
 
LVL 4

Expert Comment

by:AVaulin
ID: 1402737
You don't need to write anywhat to enable password protection because Windows enables/diables it by itself (Control Panel / Display / Screen Saver / Paasword Protected).

But if you want you can add WM_CLOSE message handler to CSaverWnd
class of Saver sample. I can show how to do it if first answer part don't acceptable to you.
0
 

Author Comment

by:Palmerj
ID: 1402738
I compiled the sample MFC screen saver (SAVER.SCR) provided with Visual C/C++ v4.0 - When clicking on the "Change Password" button, the change password dialog never appears. Even when the "password protected" check box is checked, the screen saver is not password protected. Other screen savers function as expected. Obviously, additional code must be inserted in order to enable password protection.

I don't think processing the CLOSE message is enough, since two functions are required; Allowing the password change dialog to show up, an allowing the password entry dialog before shutting down.

Thanks.
0
 
LVL 4

Expert Comment

by:davmarc
ID: 1402739
Palmerj,
I must agree with AVaulin. Password protection is handled automatically by Windows, not by the screen saver code.
Whatever screen saver you install, you'll configure passwords always the same way.

This is confirmed by the fact that there are not any entry points regarding password protection in the whole screen saver SDK documentation.

Davide Marcato.
0
 

Author Comment

by:Palmerj
ID: 1402740
Please, compile the sample MFC screen saver (SAVER) and see  for yourself. Maybe the sample provided with Visual C/C++ v4.0 has a bug?

If you have the source code for an MFC screen saver that functions with password protection, I would really appreciate it. If you wish, I can send you the source code for SAVER.SCR.

Thank-you for your response.
0
 
LVL 4

Expert Comment

by:davmarc
ID: 1402741
I think you'll find very useful info about screen saver programming at this site: http://classic.physiol.cam.ac.uk/scr.

In particular, read the paragraphs dedicated to password protection at: http://classic.physiol.cam.ac.uk/scr/SCRB_TEC.HTM#pwdchangepassword
They don't only clearly state that password management is not a problem of the screen saver developer, they also describe which functions do what and which DLL they are contained in.

Have you tried that screen saver on another computer?
If you can't, send me the compiled code at the address davmarc@ashnet.it and I'll try on mine (I don't have VC++ installed on the computer from which I am writing right now).

Davide Marcato.
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 4

Expert Comment

by:davmarc
ID: 1402742
I tried saver.scr on my PC with Win95 and behaves like yours.
I cannot reply extensively by E-Mail because you didn't write me with a valid From: field in the message! What's your address?

Davide Marcato.
0
 
LVL 23

Expert Comment

by:chensu
ID: 1402743
davmarc has answered the question. I just would like to make it clearer.

http://classic.physiol.cam.ac.uk/scr/SCRB_TEC.HTM says:
When your screen saver is required to pop up a change-password dialog, it will be invoked in the form
xxx.scr /a
for a dialog as a child of the current foreground window, or
xxx.scr /a ####
for a dialog that's a child of the window whose HWND (in decimal) is given by ####.

Saver does not implement it.

0
 

Author Comment

by:Palmerj
ID: 1402744
I would like to say that I really appreciate all your suggestions. The /a parameter is passed to the screen saver when the "Change password" button is pressed. The sample screen saver SAVER which comes with Microsoft Visual C++ does not handle this, nor does it present a password entry dialog before closing.

In the following url:

http://classic.physiol.cam.ac.uk/scr/SCRB_GEN.HTM#version

It is stated at the very end, (and I quote:)

Security. Windows NT manages all password stuff itself. If the user clicks on the Password button in the display properties control panel, the system manages the change of password itself. When the saver kicks in, it is executed on a different desktop. (This means that your saver will not be able to draw over the top of the user's desktop). (Under Win'95, the saver has to manage all of these things itself. ScrPlus does this all for
you).

End Quote.

Of particular interest is tha last sentence. It is precisely a sample of this necessary logic that I'm looking for.

Thank-you.
0
 
LVL 4

Accepted Solution

by:
davmarc earned 100 total points
ID: 1402745
Conclusions in brief.
As described in detail in this site dedicated to screen saver programmers:
http://classic.physiol.cam.ac.uk/scr
under Windows NT the system takes care of showing the password protection dialog, instead under Windows 95 it's a developer's responsibility.
More details and samples at the address above.

Davide Marcato.
0
 

Author Comment

by:Palmerj
ID: 1402746
Although a bit difficult to locate, this site does contain source code sample for implementing password protection on screen savers developed using MFC.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now