The ConLib Library


[Home]

What is the ConLib library? It's a simplified interface to the console manipulation routines in the Win32 API library. What does this mean? It means that you can write programs that allow you to manipulate the "console" (the black DOS box) that your program runs in, and you don't have to use Microsoft's functions directly. Instead, you call simpler ConLib functions to perform the same tasks.

What are some of the things you can do with the ConLib library? Well, you can:

  1. Perform cursor functions (get and set the current position anywhere on the screen)

  2. Manipulate colors (get and set the current console color attributes, as well as for text display)

  3. Perform keyboard I/O

  4. Set the title for the console window's caption

  5. Set the size of the console window

  6. Detect mouse events (i.e., clicking on an X/Y coordinate)

All you have to do is download the latest version of the ConLib library to your build system (see the table below). Then #include the ConLib header file in your modules where you call the ConLib functions, and add the appropriate ConLib library to the list of external libraries your linker will reference (details on how to do this are included in the ZIP files). Once that's in place, you can write programs that allow you to resize the console window, place the cursor at arbitrary X/Y coordinates, change colors, etc. In short, you can design more sophisticated user interfaces that support things like data entry, reports, and -- yes, even games! The functions are callable from either C or C++ programs (it's assumed you're using the Visual C++ compiler).

The libraries are completely free for anyone to use for any purpose. (Of course, no liability is assumed on behalf of the programmer with regards to the stability and/or reliability of the libraries.) If you encounter any bugs or have requests for modifications and/or additions, feel free to contact me at sedwards@fullcoll.edu

Enjoy!

Scott Edwards



File

Date

Description

ConLib2005_v_2_4_1.zip

11/19/2006

Custom build of version ConLib 2.4.1 for Visual C++ 2005 Express Edition (all other versions below are built for Visual C++ version 6).

ConLib_v_2_4_1.zip

11/08/2002

Added ConLibKeyDown macro so up/down keyboard events are now distinguishable.

ConLib_v_2_4.zip

4/18/2002

Added macros for more keyboard support (ConLibGetAsciiKeyCode, ConLibCheckControlKey, ConLibGetVirtualKeyCode); converted parameters of several functions from row/col coordinates to X/Y coordinates (ConLibInitialize, ConLibGetWinSize, ConLibSetWinSize); added some new functions (ConLibIsNT and ConLibShowCursor); fixed the Win2000 console bug so that mouse events are handled.

ConLib_v_2_3.zip

4/14/2001

Fixed bug in ConLibReadString; the function was leaving leftover data on the input stream if the caller's buffer was not large enough; added ConLibFlushInputRecords; enhanced ConLib debug information to include system error strings; added defined DOS colors to ConLib.h.

ConLib_v_2_2.zip

10/29/2000

Fixed bug in ConLibMouseButtonPressed; the function was detecting mouse wheel and movement events and mapping them to "button pressed" events; now if a mouse wheel or movement event occurs, this function will return a value of NO_MOUSE_BUTTON_PRESSED.

ConLib_v_2_1.zip

10/4/2000

Changed ConLibGetTextColor so that the caller supplies two pointers instead of one, thus freeing the caller from having to do any bitwise manipulation.

ConLib_v_2_0.zip

10/1/2000

Single-platform libraries; more mouse support; more screen support; added ConLibInitialize to initialize the library.

ConLib_v_1_2_1.zip

4/15/2000

Fixed bug in ConLibMouseButtonPressed; the caller can also now test for double-clicks. (NOTE: this build does not contain the NT libraries. I decided to release the Win9x versions right away since there are several students with projects due who can immediately benefit from the mouse bug fix!)

ConLib_v_1_2.zip

4/11/2000

Added multi-threaded versions of the library. Minor bug fixes (documented in RevisionHistory.txt).

ConLib_v_1_1.zip

3/24/2000

Added revision history file; added the "ConLibGetMouseRecCoords" function. Compiled versions for NT (4.0) are included.

ConLib_v_1_0.zip

2/11/2000

Initial revision.

 

This page was last updated on 11/08/02 10:30 AM