home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / nfsrc21.zip / PRTSCR.C < prev    next >
Text File  |  1991-08-16  |  2KB  |  77 lines

  1. /*
  2.  * File......: PRTSCR.C
  3.  * Author....: Ted Means
  4.  * Date......: $Date:   15 Aug 1991 23:08:24  $
  5.  * Revision..: $Revision:   1.2  $
  6.  * Log file..: $Logfile:   E:/nanfor/src/prtscr.c_v  $
  7.  * 
  8.  * This is an original work by Ted Means and is placed in the
  9.  * public domain.
  10.  *
  11.  * Modification history:
  12.  * ---------------------
  13.  *
  14.  * $Log:   E:/nanfor/src/prtscr.c_v  $
  15.  * 
  16.  *    Rev 1.2   15 Aug 1991 23:08:24   GLENN
  17.  * Forest Belt proofread/edited/cleaned up doc
  18.  * 
  19.  *    Rev 1.1   14 Jun 1991 19:53:54   GLENN
  20.  * Minor edit to file header
  21.  * 
  22.  *    Rev 1.0   01 Apr 1991 01:02:58   GLENN
  23.  * Nanforum Toolkit
  24.  * 
  25.  *
  26.  */
  27.  
  28.  
  29. /*  $DOC$
  30.  *  $FUNCNAME$
  31.  *     FT_PRTSCR()
  32.  *  $CATEGORY$
  33.  *     Keyboard/Mouse
  34.  *  $ONELINER$
  35.  *     Enable or disable the Print Screen key
  36.  *  $SYNTAX$
  37.  *     FT_PRTSCR( [ <lSetStat> ] ) -> lCurStat
  38.  *  $ARGUMENTS$
  39.  *     <lSetStat> set to .T. will enable the Print Screen key,
  40.  *     .F. will disable it.  If omitted, leaves status as is.
  41.  *  $RETURNS$
  42.  *     The current state: .T. if enabled, .F. if disabled.
  43.  *  $DESCRIPTION$
  44.  *     This function is valuable if you have a need to disable the
  45.  *     printscreen key.  It works by fooling the BIOS into thinking that
  46.  *     a printscreen is already in progress.  The BIOS will then refuse
  47.  *     to invoke the printscreen handler.
  48.  *  $EXAMPLES$
  49.  *     FT_PRTSCR( .F. )       && Disable the printscreen key
  50.  *     FT_PRTSCR( .T. )       && Enable the printscreen key
  51.  *     MemVar := FT_PRTSCR()  && Get the current status
  52.  *  $SEEALSO$
  53.  *     FT_CAPLOCK() FT_CTRL() FT_NUMLOCK() FT_SHIFT() FT_ALT()
  54.  *  $END$
  55.  */
  56.  
  57. #include <extend.h>
  58.  
  59. #define pbyte *((char *) 0x00000500)
  60.  
  61. CLIPPER FT_PRTSCR(void)
  62. {
  63.    if ( PCOUNT && ISLOG( 1 ) )
  64.    {
  65.       if ( _parl( 1 ) )
  66.           pbyte = 0;
  67.       else
  68.           pbyte = 1;
  69.    }
  70.    if ( pbyte == 1)
  71.       _retl( FALSE );
  72.    else
  73.       _retl( TRUE );
  74.  
  75.    return;
  76. }
  77.