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: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

  • Due to internal controls and regulations, the amount of long term archival data is increasing every year. Since magnetic tape does not need to be periodically operated or connected to a power source, there will be no data loss because of performance degradation due to the drive actuator. Read this white paper to learn about a series of tests that determined magnetic tape is a reliable long-term storage solution for up to 30 years.

Most Popular Programming Stories

More for Developers

RSS Feeds