Solved

MFC Screen Savers and Password Protection

Posted on 1997-08-01
10
334 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Event ID 10010 3 80
How to estimate memory and number of CPU for an ASP.NET Application 13 37
DB Mail Export to Excel some row wrap to new row 30 143
SSRS Deployment problem 5 125
This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 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