Screen Saver Base Class

-->

In Window95 a screen saver can be previewed in display property dialog . How can the application knows whether it runs in full screen mode or in the preview mode . If the the first parameter is 'c' you need to run config . if it is 'p' you need to create a preview window . If it is 's' you need to create full screen window .

I write the three base class which are for the common usage .
  1. One is derived from CWinApp , it(CSSApp) will judge whether runs in full screen mode or in preview mode and call the proper member function to start task .
  2. The other two are derived from CWnd , one(CFullWnd) is full screen window the other(CSmallWnd) is preview window.

There are some virtual member function in the CSSApp .

  1. InitInstance(...) It will judge the running mode and call the proper function (DoConfig, DoSmall or DoFull) .Your class derived from CSSApp must call it in InitInstance .
  2. DoConfig(...) You must override it to display your configuration dialog .
  3. DoSmall(...) You must override it to create your preview mode window . You need create a child whose parent window is CWnd* pParent = CWnd::FromHandle((HWND)atol(__argv[2])) .
  4. DoFull(...) You must override it to display the full screen window .

The class CFullWnd and CSmallWnd can be the base class of your full screen window class and preview window class . When the window is created it will generate a timer . The thing you need to do is overriding the OnTimer(...) function .

Download demo project - 177 KB

Download source - 27 KB



Comments

  • Black Background

    Posted by Legacy on 01/14/1999 12:00am

    Originally posted by: Frank Meffert

    I'm using NT4 with IE 4.01.
    
    

    In the code, member variable m_brBk is set to NULL (meaning it should be Transparent).

    In preview mode the Screen Saver works as it should (icons/windows/etc. stay visible), but when it actually gets activated with the Screen Saver timer), my desktop icons and windows disappear and only my desktop bitmap is shown. Anything I need to know about how to make the entire desktop (with icons and windows) stay visible?

    Anyone have a clue? I don't think I should have to capture the screen and re-paint it as a fake window or anything like that...

    Reply
  • screen saver parameters page

    Posted by Legacy on 01/07/1999 12:00am

    Originally posted by: Thierry Maurel

    When I try to open the parameters dialog of the screen saver, from the screen property, it doesn't appear.
    There is a little flickering (the main property page losts and gets the focus).
    Is it a referenced problem for MFC screen savers ?
    I use NT4.
    Regards,
    Thierry

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

Top White Papers and Webcasts

  • Live Event Date: August 20, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT When you look at natural user interfaces as a developer, it isn't just fun and games. There are some very serious, real-world usage models of how things can help make the world a better place – things like Intel® RealSense™ technology. Check out this upcoming eSeminar and join the panel of experts, both from inside and outside of Intel, as they discuss how natural user interfaces will likely be getting adopted in a wide variety …

  • Savvy enterprises are discovering that the cloud holds the power to transform IT processes and support business objectives. IT departments can use the cloud to redefine the continuum of development and operations—a process that is becoming known as DevOps. Download the Executive Brief DevOps: Why IT Operations Managers Should Care About the Cloud—prepared by Frost & Sullivan and sponsored by IBM—to learn how IBM SmartCloud Application services provide a robust platform that streamlines …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds