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

  • On-demand Event Event Date: October 23, 2014 Despite the current "virtualize everything" mentality, there are advantages to utilizing physical hardware for certain tasks. This is especially true for backups. In many cases, it is clearly in an organization's best interest to make use of physical, purpose-built backup appliances rather than relying on virtual backup software (VBA - Virtual Backup Appliances). Join us for this webcast to learn why physical appliances are preferable to virtual backup appliances, …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds