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

  • IBM Worklight is a mobile application development platform that lets you extend your business to mobile devices. It is designed to provide an open, comprehensive platform to build, run and manage HTML5, hybrid and native mobile apps.

  • Live Event Date: November 18, 2014 @ 11:00 a.m. EST As you embrace the hybrid world of on-premise and cloud applications, often accessed via mobile devices, you now have to be concerned that cybercriminals have yet another vehicle to attack your business. In fact, the average cost of cybercrime has increased over 10% in the last year, and this applies to businesses of all sizes. Attend this webinar to hear David Monahan, Security Research Director at EMA, and Dana Epp, recognized security luminary from …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds