A Complete Screen Saver Framework Using MFC | CodeGuru

A Complete Screen Saver Framework Using MFC

This article was contributed by chensu. Environment: Visual C++ 6.0 with Service Pack 3, Windows 9x and Windows NT 4.0 with Service Pack 3 Here is a complete screen saver framework. It is based on the MFC sample “SAVER: Screen Saver” that comes with Visual C++. But I added more functionality so that it does […]

Written By
CodeGuru Staff
CodeGuru Staff
Jul 29, 1999
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

This article was contributed by
chensu.

Environment: Visual C++ 6.0 with Service Pack 3, Windows 9x and Windows NT 4.0 with Service Pack 3

Here is a complete screen saver framework. It is based on the MFC sample “SAVER: Screen Saver” that
comes with Visual C++. But I added more functionality so that it does everything a screen saver needs to do.
To help you understand it and insert your own code, I removed all the drawing code so that it is as simple as possible
(blank screen). In addition, I wrote a simple installation program. This installation program puts the screen saver (saver.scr)
into its resource so that only one executable file (sinstall.exe) needs to be distributed. The Project Workspace
contains two projects. One is the screen saver itself, another is the installation program.

In most cases, you will only need to make the following modifications.

  • Add drawing code in the drawwnd.h and drawwnd.cpp.
  • Add a configuration dialog box, launch it in the CSaverApp::DoConfig function of the saver.cpp.
  • Add your own resource if any (resource.h and saver.rc).

For your reference, I list some Web sites related to Windows screen saver programming here.

Happy Screen Saving!

Downloads


Download Source Code – 161 Kb
CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.