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: September 10, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild". This loop of continuous delivery and continuous feedback is …

  • Java developers know that testing code changes can be a huge pain, and waiting for an application to redeploy after a code fix can take an eternity. Wouldn't it be great if you could see your code changes immediately, fine-tune, debug, explore and deploy code without waiting for ages? In this white paper, find out how that's possible with a Java plugin that drastically changes the way you develop, test and run Java applications. Discover the advantages of this plugin, and the changes you can expect to see …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds