home *** CD-ROM | disk | FTP | other *** search
- #define STRICT
- #include <WINDOWS.H>
- #include <MEMORY.H>
- #include <STRING.H>
- #include <STDLIB.H>
-
- #define TIMERID 1000
-
- HINSTANCE ghInstDLL = (HINSTANCE) 0;
- char gszAppName [] = "MONEYSS";
- char gszScreenSaverName [] = "Dollar Sign Screen Saver";
- UINT nTimer = 0;
-
- LPSTR WINAPI _export GetScreenSaverName (void);
- void WINAPI _export CreateScreenSaver (HWND);
- void WINAPI _export DisplayScreenSaver (HWND);
- void WINAPI _export DestroyScreenSaver (HWND);
- void WINAPI _export ScreenSaverOptionsDlg (void);
-
- // Compile and link this as "MONEY.DLL" and then rename it to "MONEY.DSS".
- // Copy it to your Windows directory and from the DeskTop applet select
- // "ScreenSaver Shell". Then select "Setup", "Select", and "MONEY.DSS".
-
- // This is for the Set Options dialog box title.
- LPSTR WINAPI _export
- GetScreenSaverName
- (void)
- {
- return (gszScreenSaverName);
- } // GetScreenSaverName
-
- // Create a timer and perform any initialization here.
- void WINAPI _export
- CreateScreenSaver
- (HWND hWnd)
- {
- nTimer = SetTimer (hWnd, TIMERID, 1000, NULL);
- } // CreateScreenSaver
-
- // Do your "screensaver thing" here.
- void WINAPI _export
- DisplayScreenSaver
- (HWND hWnd)
- {
- HDC hDc;
- RECT Rect;
- HFONT hFont, hFontOld;
- LOGFONT lf;
- COLORREF iPrevTextColor;
-
- hDc = GetDC (hWnd);
- GetWindowRect (hWnd, &Rect);
- FillRect (hDc, &Rect, GetStockObject (WHITE_BRUSH));
- memset (&lf, 0, sizeof (LOGFONT));
- lf.lfHeight = -60;
- lf.lfWeight = FW_BOLD;
- strcpy (lf.lfFaceName, "Times New Roman");
- hFont = CreateFontIndirect (&lf);
- hFontOld = SelectObject (hDc, hFont);
- iPrevTextColor = SetTextColor (hDc, RGB (0, 150, 0));
- TextOut (hDc,
- (int) ((long) (640 * (long) rand ()) / (long) RAND_MAX),
- (int) ((long) (480 * (long) rand ()) / (long) RAND_MAX),
- "$end Money!", 11);
- SetTextColor (hDc, iPrevTextColor);
- SelectObject (hDc, hFontOld);
- DeleteObject (hFont);
- ReleaseDC (hWnd, hDc);
- } // DisplayScreenSaver
-
- // Return any windows resources you may have used here.
- void WINAPI _export
- DestroyScreenSaver
- (HWND hWnd)
- {
- KillTimer (hWnd, nTimer);
- } // DestroyScreenSaver
-
- // Setup an options dialog procedure here with MakeProcInstance, DialogBox, etc.
- void WINAPI _export
- ScreenSaverOptionsDlg
- (void)
- {
- } // ScreenSaverOptionsDlg
-
- #ifdef __BORLANDC__
- #pragma argsused
- #endif
- int FAR PASCAL
- WEP
- (int iParameter)
- {
- return (1);
- } // WEP
-
- #ifdef __BORLANDC__
- #pragma argsused
- #endif
- int CALLBACK
- LibMain
- (HINSTANCE hInst,
- WORD wDataSeg,
- WORD wHeap,
- LPSTR szCmdLine)
- {
- if (wHeap > 0)
- UnlockData (0);
- ghInstDLL = hInst;
- return (1);
- } // LibMain
-