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

  • Live Event Date: September 10, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild". This loop of continuous delivery and continuous feedback is …

  • A global data storage provider whose business is booming needed a best-in-class data center to serve as the backbone of its technical operations going forward—and it needed it delivered within a year.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds