TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: David Etheredge
from: Phil Crown
date: 1995-04-01 15:10:24
subject: screen color in OS/2

DE> I am writing a program designed for the OS/2 full screen mode and need
 DE> to use  different colored characters on the screen. In dos,there are

 Here's some functions I use to write colored text to the screen.  It may
 give you an idea how to do it.

// --------------------------------------------------------------------
// print a string at current row, column,

void  pstra( char *String, PBYTE attr )
{
  USHORT  Row, Column;

  VioGetCurPos( &Row, &Column, 0 );
  VioWrtCharStrAtt( String, strlen(String), Row, Column, attr, 0 );
  VioSetCurPos( Row, Column + strlen(String), 0 );
}

// --------------------------------------------------------------------
// print string at row, col, attribute

void  pstraxy( char *String, USHORT Row, USHORT Column, PBYTE attr )
{
  VioWrtCharStrAtt( String, strlen(String), Row, Column, attr, 0 );
  VioSetCurPos( Row, Column + strlen(String), 0 );
}

// --------------------------------------------------------------------
// write one char to the sceen at row, col, attr

void    vputchr( PCH Char, USHORT Row, USHORT Column, PBYTE Color )
{
  VioWrtNChar( Char , 1, Row, Column, 0 );
  VioWrtNAttr( Color, 1, Row, Column, 0 );
}

Phil


--- Blue Wave/Max v2.20p OS2 Beta
* Origin: Crown Point (1:124/6108.2)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 124/6108 1014 1 396/1 270/101 105/103 42 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.