Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

#include <scrnsave.h>

7 views
Skip to first unread message

Lars Andre

unread,
Jan 19, 1997, 3:00:00 AM1/19/97
to

Jeg får følgende feil melding:

Unable to open include file 'SCRNSAVE.H'

Håper noen kan hjelpe meg.

Jeg bruker Borland 5.0, og lager en screensaver for Win95.

Takk på forhånd.

Hilsen: Lars Andre
lan...@cyberdude.com

--------------------------------------------------------------------------------

#include <windows.h>
#include <scrnsave.h>

/* This is the message */
char str[80] = "#Horten er den beste kanalen";

/* This is the timer delay */
int delay = 200;

LRESULT CALLBACK ScreenSaverProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
static HDC hdc;
static timer;
static RECT scrdim;
static SIZE size;
static X = 0, Y = 0;
static HBRUSH hBlkBrush;
static TEXTMETRIC tm;

switch(message)
{
case WM_CREATE:
timer = SetTimer(hwnd, 1, delay, NULL);
hBlkBrush = GetStockObject(BLACK_BRUSH);
break;
case WM_ERASEBKGND:
hdc = GetDC(hwnd);

GetClientRect(hwnd, &scrdim);

SelectObject(hdc, hBlkBrush);
PatBlt(hdc, 0, 0, scrdim.right, scrdim.bottom, PATCOPY);

GetTextMetrics(hdc, &tm);
GetTextExtentPoint32(hdc, str, strlen(str), &size);

releaseDC(hwnd, hdc);
break;
case WM_TIMER:
hdc = GetDC(hwnd);

SelectObject(hdc, hBlkBrush);
PatBlt(hdc, X, Y, X + size.cx, Y + size.cy, PATCOPY);

X += 10; Y += 10;
if(X > scrdim.right) X = 0;
if(Y > scrdim.bottom) Y = 0;

SetBkColor(hdc, RGB(0, 0, 0));
SetTextColor(hdc, RGB(0, 255, 255));

TextOut(hdc, X, Y, str, strlen(str));

ReleaseDC(hwnd, hdc);
break;
case WM_DESTROY:
KillTimer(hwnd, timer);
break;
default:
return DefScreenSaverProc(hwnd, message, wParam, lParam);
}
return 0;
}

BOOL CALLBACK ScreenSaverConfigureDialog(HWND hdwnd, UINT message,
WPARAM wParam, LPARAM, lParam)
{
return 0;
}

BOOL WINAPI RegisterDialogClasses(HINSTANCE hInst)
{
return 1;
}


Jan Kroken

unread,
Jan 20, 1997, 3:00:00 AM1/20/97
to

lan...@cyberdude.com (Lars Andre) writes:


>
> Jeg får følgende feil melding:
>
> Unable to open include file 'SCRNSAVE.H'
>
> Håper noen kan hjelpe meg.
>
> Jeg bruker Borland 5.0, og lager en screensaver for Win95.
>
> Takk på forhånd.

> #include <windows.h>
> #include <scrnsave.h>

Kanskje #include "scrnsave.h" ville hjelpe?

--
-jk


Odd Gunnar Malin

unread,
Jan 25, 1997, 3:00:00 AM1/25/97
to

Ligger ikke scrnsave.h i katalogen \bc5\include\win32
skriv da:
#include <win32\scrnsave.h>
OGMalin

Jan Kroken <ja...@maud.ifi.uio.no> wrote in article
<vhi7ml8...@maud.ifi.uio.no>...

Lars Andre

unread,
Jan 26, 1997, 3:00:00 AM1/26/97
to

"Odd Gunnar Malin" <ma...@online.no> wrote:

>Ligger ikke scrnsave.h i katalogen \bc5\include\win32
>skriv da:
>#include <win32\scrnsave.h>
>OGMalin

Jupp.
Tusen takk for hjelpen folkens.

Hilsen: Lars Andre
lan...@image.no
http://home.sol.no/landas/


0 new messages