Screen Saver which Displays Pictures

This is a simple screen saver, which display sequentially all pictures in a directory (bitmaps, metafiles, GIF's, JPEG's, PNG's). The default directory is the directory of the screen saver, but you can change it.

Some problems there are still with that screen saver:

  1. The "Configure"-button in the "Screen saver"-property sheet does not work correctly. To configure you must call the .scr file directly without parameters (or right click in explorer and choose "Configure").
  2. The screen saver is not able to display other graphics like PCX, TIFF and so on.
  3. Win95 could crash when trying to display bitmaps with too high resolution, WinNT has no problem there.

If anybody knows how to fix the problems please send me a mail, so that everybody can benefit from it.

Thanks Oliver Reuther for the idea, Alejandro Auilar Sierra for the CImage-class, Robert Caldecott for his Metafile class and Zafir Anjum for some bitmap related routines.

When you have some nice pictures like Error-MessageBoxes or Warnings, please feel free to send me these pictures as e-mail. I will include them in my project (by adding a copyright-notice of the author), and you will get newest versions of the screen saver per e-mail.

Download demo project & source - 756KB



Comments

  • another fix for config problem

    Posted by Legacy on 05/04/1999 12:00am

    Originally posted by: Jon Tanner

    On Microsoft's website, they have a fix for the config problem, because the way Win98 handles command strings
    is different than 95.
    
    

    so here is the code they recommend ( i've tested it on 95,98,and NT)

    BOOL MatchOption(LPTSTR lpsz, TCHAR ch)
    {
    if (lpsz[0] == '-' || lpsz[0] == '/')
    lpsz++;
    if (lpsz[0] == ch)
    return TRUE;
    return FALSE;
    }

    and in InitInstance()

    if ( __argc == 1 || MatchOption(__argv[1], _T('c')))
    DoConfig();

    else if (MatchOption(__argv[1], _T('s')) || MatchOption(__argv[1], _T('S')))
    {
    CSaverWnd* pWnd = new CSaverWnd;
    pWnd->Create();
    m_pMainWnd = pWnd;
    return TRUE;
    }

    -note, you have to add the capital 'S' because 98 and 95 return different cases, and the new version doesn't reduce all to lower case

    Reply
  • Fixing problem 1

    Posted by Legacy on 10/05/1998 12:00am

    Originally posted by: Nguyen Duc Dung

    I' m developing a screen saver engine basing on the MFC Screen Saver
    sample. I had the same problem (problem 1). I don't know much about
    promble 2&3, I think that depends on the image library. The Configure
    button works well in Windows95 but doesn't in Windows98 and WindowsNT.
    I think that because the way Windows invokes screen saver has changed.
    The problem here is the MatchOption() function. I have the following
    solution:

    At line 66 of DlgScrSaver.cpp (function CSaverApp::InitInstance())

    if (__argc == 1 || MatchOption(__argv[1], _T("c")))

    should be replaced by

    if (__argc == 1 || __argv[1][1]=='c'||__argv[1][0]=='c')

    Now it works in both Windows9x and WindowsNT.

    NDD


    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: November 20, 2014 @ 2:00 p.m. ET / 11:00 a.m. PT Are you wanting to target two or more platforms such as iOS, Android, and/or Windows? You are not alone. 90% of enterprises today are targeting two or more platforms. Attend this eSeminar to discover how mobile app developers can rely on one IDE to create applications across platforms and approaches (web, native, and/or hybrid), saving time, money, and effort and introducing apps to market faster. You'll learn the trade-offs for gaining long …

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds