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

  • You may already know about some of the benefits of Bluemix, IBM's open platform for developing and deploying mobile and web applications. Check out this webcast that focuses on building an Android application using the MobileData service, with a walk-through of the real process and workflow used to build and link the MobileData service within your application. Join IBM's subject matter experts as they show you the way to build a base application that will jumpstart you into building your own more complex app …

  • Packaged application development teams frequently operate with limited testing environments due to time and labor constraints. By virtualizing the entire application stack, packaged application development teams can deliver business results faster, at higher quality, and with lower risk.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds