// Harbour isprinter.c adapted source code for Borland C 16 bits
#include <Winten.h>
#include <Windows.h>
#include <ClipApi.h>
int strnicmp( char *, char *, int );
int atoi( char * );
BOOL hb_printerIsReady( char * pszPrinterName )
{
BOOL bIsPrinter;
{
USHORT uiPort;
if( pszPrinterName == NULL )
pszPrinterName = "LPT1";
if( strnicmp( pszPrinterName, "PRN", 3 ) == 0 )
{
_AH = 2;
_DX = 0; /* LPT1 */
asm int 0x11; // 17
bIsPrinter = ( _AH == 0x90 );
}
else if( strlen( pszPrinterName ) >= 4 &&
strnicmp( pszPrinterName, "LPT", 3 ) == 0 &&
( uiPort = atoi( pszPrinterName + 3 ) ) > 0 )
{
_DX = uiPort - 1;
_AH = 2;
asm int 0x11; // 17
bIsPrinter = ( _AH == 0x90 );
}
else
bIsPrinter = FALSE;
}
return bIsPrinter;
}
void pascal HB_ISPRINTER( void )
{
_retl( hb_printerIsReady( _parc( 1 ) ) );
}
#include <ClipApi.h>
void pascal ISPRN( void )
{
_DX = _parni( 1 ) - 1;
_AH = 2;
asm int 0x11; // 17
_retl( _AL == 0x90 );
}
#include <ClipApi.h>
void pascal ISPRN( void )
{
_DX = _parni( 1 ) - 1;
_AH = 2;
asm int 0x17;
_retl( _AL == 0x90 );
}
#include "FiveWin.ch"
function IsPrn()
local lResult, oPrn
PRINT oPrn
lResult = ! Empty( oPrn:hDC )
ENDPRINT
return lResult
Return to FiveWin for CA-Clipper
Users browsing this forum: No registered users and 8 guests