home *** CD-ROM | disk | FTP | other *** search
- /*
-
-
-
- CAPTURE.h
-
-
- Copyright (c) 1990 by: Arthur Kevin McGrath
- Contract Engineers
- P. O. Box 128
- Barboursville, VA 22923
-
- 703/832-7025
-
-
- ALL RIGHTS ARE RESERVED. You may not copy this program in any way
- except to make back-up copies FOR YOUR OWN USE. If you copy this
- program for any reason without WRITTEN PERMISSION from the above
- named copyright owner (except to make back-up copies FOR YOUR OWN USE),
- you are breaking the Copyright Laws of the United States. You will go
- to jail for one year and pay a $50,000 fine.
-
-
-
-
- */
-
- #define STACK_KILLER_QUEUE ( "\\queues\\killstk$.$$$" )
- #define NO_QUEUE_SEMAPHORE 0L
- #define NEXT_QUEUE_MESSAGE ( ( USHORT )0 )
-
- #define THIS_THREAD_ONLY 0
-
-
- /* The following are used by various STACK ALLOCATION functions. */
- #define STACK_SIZE 20000
- #define STACK_KILLER_STACK 2000
- #define NOSHARE_NODISCARD 0
-
- #define LONGEST_FILE_NAME 13
- #define LONGEST_PATH_NAME 256
-
-
- /* For the DosOpen call. */
- #define ARCHIVE ( 1 << 5 )
-
- /* For our CAPTURE_FLAG in main() */
- #define ALL_ASCII_CHARACTERS FALSE
- #define PRINTABLE_ASCII_ONLY ( !(FALSE) )
-
- /* For the VioPopUp session. */
- #define TRANSPARENT 2
- #define NON_TRANSPARENT 0
- #define WAIT_FOR_POP_UP 1
- #define NO_WAIT_FOR_POP_UP 0
-
- #define GET_FILE_NAME 0xF000
- #define FAREWELL 0xF001
- #define MALLOC_ERROR 0xF002
- #define RESULTS 0xF003
-
- #define DEFAULT_SCREEN_HANDLE 0
- #define RESERVED 0
-
- /* VioPopUp session colors. */
- #define BLACK 0
- #define BLUE 1
- #define GREEN 2
- #define CYAN 3
- #define RED 4
- #define MAGENTA 5
- #define BROWN 6
- #define GREY 7
-
- #define BRIGHT 8
- #define BACKGROUND(x) ( ( x << 4 ) )
-
- #define POPUP_BACKGROUND_COLOR ( BACKGROUND( GREEN ) | BRIGHT | GREY )
- #define NORMAL_TEXT_COLOR ( BACKGROUND( GREEN ) | BRIGHT | GREY )
- #define HILITE_TEXT_COLOR ( BACKGROUND( GREEN ) | BRIGHT | BROWN )
- #define ERROR_TEXT_COLOR ( BACKGROUND( RED ) | BRIGHT | BROWN )
-
- /* Text for various pop up sessions. */
- #define FAREWELL_STRING ( " has ended." )
- #define RESULTS_1 ( "The screen capture attempt was " )
- #define RESULTS_SUCCESS ( "SUCCESSFUL!!!" )
- #define RESULTS_FAILURE ( "UNSUCCESSFUL." )
- #define ERROR_INTRO ( "The error was" )
- #define DEFAULT_FILE_NAME ( default_file_name )
-
- #define MIN(x,y) ( ( x<y ) ? x : y )
-
-
- struct screen_text
- {
- char letter;
- unsigned char attribute;
-
- };
-
-
- /* The following structure will be passed through a queue
- to tell one thread when it is safe to blow away another
- thread's stack. */
- struct stack_selector
- {
- TID id;
- SEL stack;
-
- };
-
-
-
-
-
-
-
- /* Function prototypes. */
- USHORT center_the_line( USHORT left, USHORT right, USHORT string_length );
-
- void get_string( char *default_data, char *string,
- USHORT size,
- USHORT row,
- USHORT column,
- USHORT width,
- HKBD keyboard );
-
- void get_file_name( USHORT left,
- USHORT right,
- USHORT top,
- char *file_name );
-
- void results( USHORT left,
- USHORT right,
- USHORT top,
- unsigned failure );
-
- void farewell( USHORT left,
- USHORT right,
- USHORT top );
-
- int pop_up( enum popup_type type, char *file_name, unsigned failure );
-
- int monitor_the_keyboard( void );
-
- SEL stack_segment( void );
-
-
- /* The following are functions that are called in place ot
- the standard C runtime functions from threads other than
- thread one. */
- void thread_copy( char *destination, char *source );
- void thread_cat( char *destination, char *source );
- int thread_strlen( char *string );
- void mark_stack( char *stack, unsigned length );
-
- /* Thread prototypes. */
- PFNTHREAD capture_the_screen( void );
- PFNTHREAD free_the_stack( void );