Text Output Screen

Environment: VC6, NT, WIN2000, WIN9x,

This is a set of functions (packaged in a DLL) that allows for easy text output to a text window.

Example Usage

Here's an example code snippet on using these functions.
#include "stdafx.h"
#include "screen.h"

int main(int argc, char* argv[])
{
 // Show Screen displays a new screen and returns a handle to it
 int h=ShowScreen(30,10,"Example!",0,255,5,5,15);

 // SetScrRedraw sets the type if redrawing (true=RedrawWindow or 
 // false=WM_PAINT message)
 SetScrRedraw(h,true);

 // pf works the same as printf except that it takes the screen 
 // handle (returned via ShowScreen) as the first argument
 for(int i=0; i<3000; i++) pf(h,"Var i = %d\n",i);

 return 0;
}

Function Prototypes

Here are the main functions exported from the DLL.
int ShowScreen( int w,int h, // Window size in char (X,Y) 
 char *Banner=0, // Window Title
 int colB=0, // Background color
 int colT=0x8080ff, // Text color
 int x=0,int y=0, // Window pos
 int fSize=10); // Font size

void DestroyScreen(int h);
HWND GetHwnd(int h);
void ClrScr(int h);
void SetPos(int h,int x,int y);
void SetChar(int h,int x,int y,char c);
void SetScrRedraw(int h,int r);
int pf(int h,char *txt,...);

Downloads

Download demo project - 31 Kb
Download source - 11 Kb
Download client files (dll , lib , h file) - 7 Kb


Comments

  • textoutput

    Posted by Legacy on 08/04/2001 12:00am

    Originally posted by: antonio ramirez

    I've a problem with the linker the errors are:
    sdsvcDlg.obj : error LNK2001: unresolved external symbol __imp__ShowScreen
    Debug/sdsvc.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Today's competitive marketplace requires the organization to frequently release and deploy applications at the pace of user demands, with reduced cost, risk, and increased quality. This book defines the basics of application release and deployment, and provides best practices for implementation with resources for a deeper dive. Inside you will find: The business and technical drivers behind automated application release and deployment. Evaluation guides for application release and deployment solutions. …

  • The latest release of SugarCRM's flagship product gives users new tools to build extraordinary customer relationships. Read an in-depth analysis of SugarCRM's enhanced ability to help companies execute their customer-facing initiatives from Ovum, a leading technology research firm.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds