home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip Hitware 10
/
Chip_Hitware_Vol_10.iso
/
chiphit
/
multmedi
/
95licht
/
install.dll
/
1001
/
1
/
CBLANKER.C
< prev
next >
Wrap
C/C++ Source or Header
|
1997-01-04
|
4KB
|
141 lines
#include <windows.h>
#include <time.h>
#include <stdlib.h>
#include "lgdapi.h"
#include "lgduti.h"
#pragma hdrstop
// defines variables for color palettes (include in 1 file only)
//#include "lgdapi.inc"
BOOL LGDCALL ScrInfo (PLgdInfoStruct plisInfo)
{
if (plisInfo->cBytes < sizeof (TLgdInfoStruct))
return FALSE; // structure too small
if (plisInfo->lMagic != CMAGIC)
return FALSE;
plisInfo->afSaverFlags = SCR_LEAVESBLANK | SCR_HELPAVAILABLE;
strcpy (plisInfo->strTitle, "BBlanker C");
strcpy (plisInfo->strInfo, "Blanker Screen Saver\n\n"
"C Sample screen saver\n\n"
"C Source code included!");
strcpy (plisInfo->strHelpFile, "LGD95.HLP");
strcpy (plisInfo->strHelpKey, "BBlanker");
return TRUE;
}
/* fpScrInfo = Function (var lisInfo: TLgdInfoStruct): bool; stdcall;
{ index 11; requests information about screen saver }*/
BOOL LGDCALL ScrAbout (HWND hwndParent)
{
LgdAboutBox (hwndParent, 0,
"BBlanker C",
"⌐ 1996-1997 Thomas H÷vel Software\n"
"Saturnstra▀e 45, 53842 Troisdorf, Germany\n"
"All rights reserved!",
TRUE,
3);
return TRUE;
}
/* fpScrAbout = Function (hwndParent: HWND): bool; stdcall;
{ index 12; display information about screen saver }*/
BOOL LGDCALL ScrInit (PModuleData pmdModuleData)
{
pmdModuleData->pms->fSupportsIdleFunction = TRUE;
pmdModuleData->pms->lCallDelay = 1;
pmdModuleData->pms->lTimerDelay = 100;
randomize ();
return TRUE;
}
/* { these functions are called to execute the screen saver }
fpScrInit = Function (pmdModuleData: Pointer {PModuleData}): bool; stdcall;
{ index 13; init screen saver - should save pointer to structure }*/
BOOL LGDCALL ScrDone (PModuleData pmdModuleData)
{
return TRUE;
}
/* fpScrDone = Procedure (pmdModuleData: Pointer {PModuleData}); stdcall;
{ index 14 }*/
void LGDCALL ScrIdle (PModuleData pmdModuleData)
{
HDC dc;
int x, y;
dc = GetDC (pmdModuleData->pms->hwndSaver);
x = random (pmdModuleData->pms->cxScreen);
y = random (pmdModuleData->pms->cyScreen);
SetPixel (dc, x-1, y, RGB (0, 0, 0));
SetPixel (dc, x+1, y, RGB (0, 0, 0));
SetPixel (dc, x, y-1, RGB (0, 0, 0));
SetPixel (dc, x, y+1, RGB (0, 0, 0));
SetPixel (dc, x, y, RGB (0, 0, 0));
ReleaseDC (pmdModuleData->pms->hwndSaver, dc);
}
/* fpScrIdle = Procedure (pmdModuleData: Pointer {PModuleData}); stdcall; { called at maximum rate if requested by saver }
{ index 15 }*/
void LGDCALL ScrTimer (PModuleData pmdModuleData)
{
HDC dc;
int x, y;
dc = GetDC (pmdModuleData->pms->hwndSaver);
x = random (pmdModuleData->pms->cxScreen);
y = random (pmdModuleData->pms->cyScreen);
SetPixel (dc, x-1, y, RGB (192, 192, 192));
SetPixel (dc, x+1, y, RGB (192, 192, 192));
SetPixel (dc, x, y-1, RGB (192, 192, 192));
SetPixel (dc, x, y+1, RGB (192, 192, 192));
SetPixel (dc, x, y, RGB (255, 255, 255));
ReleaseDC (pmdModuleData->pms->hwndSaver, dc);
}
/* fpScrTimer = Procedure (pmdModuleData: Pointer {PModuleData}); stdcall;{ called by timer with selected interval }
{ index 16 }*/
#define PAS2C(pas, c) {strncpy ((c), &((pas)[1]), 255);\
(c)[(pas)[0]] = 0;}
int LGDCALL ScrConfig (PModuleData pmdModuleData, HWND hwndParent)
{
/*
CHAR achString [256];
CHAR achString2 [256];
PAS2C (pmdModuleData->pms->sCallerName, achString);
PAS2C (pmdModuleData->pms->sSaverName, achString2);
MessageBox (hwndParent,
achString,
achString2,
MB_OK);
*/
MessageBox (hwndParent,
"No options available!",
"Triangle Screen Saver",
MB_OK);
return 0;
}
/* fpScrConfig = Function (pmdModuleData: Pointer; hwndParent: HWND): integer; stdcall;
{ index 17; display configuration dialog }*/