home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
300-399
/
ff378.lzh
/
Observer
/
observer.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-10-10
|
2KB
|
115 lines
/*
Observer.c
zeigt ständig die Namen aller eingelegten Disketten (DF0: - DF3) an.
© 1989, by Ølli/Ultimate Computer Arts
Landsberge 5
4322 Sprockhövel
West Germany
für Lettuce-C V5.04, mit "cback.o" linken
Hinweis: Die System-Gadgets werden nicht mehr angezeigt,
trotzdem kann man das Fenster bewegen, nach vorne/hinten
clicken, schließen!
Geschrieben für das AmigaJUICE-Diskmagazin.
AmigaJUICE gibts gegen Leerdisk und Rückumschlag, oder DM 4,-, beim
Autor (siehe oben!)
*/
char *_procname="Big Brother is watching you!";
long _priority=0;
long _BackGroundIO=0;
long _stack=2624;
#include <libraries/dos.h>
#include <intuition/intuition.h>
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/graphics.h>
#include <proto/dos.h>
/* meine private tr.lib */
#include <tool.h>
struct InfoData di;
struct NewWindow nw={640-483,0,483,19,2,0,CLOSEWINDOW|DISKINSERTED|DISKREMOVED|REFRESHWINDOW|ACTIVEWINDOW|INACTIVEWINDOW,
RMBTRAP|WINDOWDRAG|WINDOWDEPTH|WINDOWCLOSE|SIMPLE_REFRESH,
0,0,0,0,0,0,0,0,0,WBENCHSCREEN};
struct Window *w;
struct RastPort *rp;
char drive[5]={"DF0:"};
void _main(void);
void exit(void);
char *exam(int);
void doit(void);
char *exam(n)
int n;
{
long lock;
struct DosList *dl;
char *str;
drive[2]='0'+n;
if(!(lock=Lock(drive,SHARED_LOCK))) {
return(IoErr()==218?"drive not mounted":"no disk in drive");
}
Info(lock,&di);
UnLock(lock);
dl=BADDR(di.id_VolumeNode);
str=BADDR(dl->dol_Name);
return(&str[1]);
}
void doit()
{
int c;
ClearScreen(rp);
setapen(1);
move(0,0);
draw(482,0);
draw(482,18);
draw(0,18);
draw(0,0);
setapen(2);
move(0,9);
draw(482,9);
move(241,0);
draw(241,18);
setapen(3);
for(c=0; c<4; c++) {
move((c&1)?242:1,(c&2)?16:7);
textf("%-30.30s",exam(c));
}
}
void _main()
{
openlibs();
if(!(w=OpenWindow(&nw))) exit();
rp=w->RPort;
setdoserror((struct Window*)-1);
SetWindowTitles(w,0,"The Observer - written & © 1990 by Ølli");
doit();
for(;;) {
wgetmsg();
if(class==CLOSEWINDOW) {
CloseWindow(w);
exit();
}
doit();
}
}