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

  • IBM Worklight is a mobile application development platform that lets you extend your business to mobile devices. It is designed to provide an open, comprehensive platform to build, run and manage HTML5, hybrid and native mobile apps.

  • New IT trends to support worker mobility — such as VDI and BYOD — are quickly gaining interest and adoption. But just as with any new trend, there are concerns and pitfalls to avoid.  Download this paper to learn the most important considerations to keep in mind for your VDI project.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds