// // CXL_EPM.CPP // // Source file for ArchiveLib 2.0 // // Copyright (c) Greenleaf Software, Inc. 1994-1996 // All Rights Reserved // // CONTENTS // // EditDisplay() // // REVISION HISTORY // // February 14, 1996 2.0A : New release #include "arclib.h" #if !defined( AL_IBM ) #pragma hdrstop #endif #include #include // // NAME // // EditDisplay() // // PLATFORMS/ENVIRONMENTS // // PM // C++ C // // SHORT DESCRIPTION // // printf() to an edit/text control. // // C++ SYNOPSIS // // #include "arclib.h" // #include "pmutil.h" // // extern "C" // void EditDisplay( HWND hDlg, // int control_id, // char *fmt, // ... ); // // C SYNOPSIS // // #include "arclib.h" // // void EditDisplay( HWND hDlg, // int control_id, // char *fmt, // ... ); // // VB SYNOPSIS // // None, there is no VB for OS/2. // // DELPHI SYNOPSIS // // None, there is no Delphi for OS/2. // // ARGUMENTS // // hDlg : This argument is a window handle. If the next parameter, // control_id, is set to -1, it means this is the handle of // the window that will have some new text written to it. // If control_id is some other value, it means this is the // handle of a dialog box, and control_id refers to an edit // control within the dialog box. That edit control is the // destination for the text output. // // control_id : The id of the multiline edit control in a dialog box. If // set to -1, it means the edit control is not in a dialog box, // and the hDlg parameter is the handle of the edit control. // // fmt : The format parameter to be used in wsprintf. // // ... : Any additional arguments that are going to be used by // vsprintf(). // // // DESCRIPTION // // This little function lets you use a printf() style command to print // data to a multiline edit control. The internal buffer is only 128 // bytes, so please be careful. // // RETURNS // // Nothing. // // EXAMPLE // // SEE ALSO // // REVISION HISTORY // // February 14, 1996 2.0A : New release // extern "C" AL_LINKAGE void AL_CFUNCTION EditDisplay( HWND hDlg, /* Tag public function */ int control_id, char AL_DLL_FAR *fmt, ... ) { char buffer[ 128 ]; HWND window; va_list args; va_start( args, fmt ); vsprintf( buffer, fmt, args ); va_end( args ); if ( control_id == -1 ) window = hDlg; else window = WinWindowFromID( hDlg, control_id ); WinSendMsg( window, MLM_INSERT, MPFROMP( (PSZ) buffer ), 0 ); }