home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Games 1996 October
/
Amiga_Games_Extra_CD_10-96.bin
/
userbox
/
publicdomain
/
grabkey
/
source
/
gk_grab.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-07-15
|
1KB
|
121 lines
/*
** GrabKEY
**
** © 1996 by Timo C. Nentwig
** All Rights Reserved !
**
** Tcn@techbase.in-berlin.de
**
**
*/
/// #include
#include "gk_GST.h"
#include "gk_Protos.h"
///
/// proto
proto BOOL Grab (const ULONG What, const ULONG Where);
///
/// Grab ()
/*
* FUNCTION Grab something to somewhere.
*
* NOTE Values for <What>/<Where> in gk_GST.h
*
* EXAMPLE Grab (WINDOW, DEF_FILE);
*
*/
BOOL
Grab (const ULONG What, const ULONG Where)
{
Object *Image = NULL; // NULL is very important !
// Load notification sound
PlaySound (Set -> Sound . Start);
// Get image
if (GetImage (&Image, What))
{
switch (Where)
{
// Save to file
case TO_FILE:
// No output specified, open Requester
if (StrEmpty (Set -> File . Path))
{
UBYTE File [256];
STRCPY (File, GetFile());
if ( ! (StrEmpty (File)))
{
SaveImage (Image, File);
}
}
else
{
SaveImage (Image, Set -> File . Path);
}
break;
// Save to printer
case TO_PRINTER:
PrintImage (Image);
break;
// Save to clipboard
case TO_CLIPBOARD:
SaveClipboard (Image);
break;
}
// Alright, dispose DT object
DisposeDTObject (Image);
}
else
{
ErrorRequest ("OK", LocaleString (MSG_ERR_GETIMAGE));
}
// Load notification sound
PlaySound (Set -> Sound . Done);
return (FALSE);
}
///