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: May 6, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT While you likely have very good reasons for remaining on WinXP after end of support -- an estimated 20-30% of worldwide devices still are -- the bottom line is your security risk is now significant. In the absence of security patches, attackers will certainly turn their attention to this new opportunity. Join Lumension Vice President Paul Zimski in this one-hour webcast to discuss risk and, more importantly, 5 pragmatic risk mitigation techniques …

  • Instead of only managing projects organizations do need to manage value! "Doing the right things" and "doing things right" are the essential ingredients for successful software and systems delivery. Unfortunately, with distributed delivery spanning multiple disciplines, geographies and time zones, many organizations struggle with teams working in silos, broken lines of communication, lack of collaboration, inadequate traceability, and poor project visibility. This often results in organizations "doing the …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds