This call outputs the message in a buffer passed by a caller to the specified handle. The function formats the buffer to prevent words from wrapping if displayed to a screen.

Syntax

DosPutMessage (FileHandle, MessageLength, MessageBuffer)

Parameters

;FileHandle (USHORT) - input : Handle of the output file or device. ;MessageLength (USHORT) - input : Length of the message to be output. ;MessageBuffer (PCHAR) - input : Address of the buffer that contains the returned message.

Return Code

rc (USHORT) - return Return code descriptions are: * 0 NO_ERROR * 6 ERROR_INVALID_HANDLE * 19 ERROR_WRITE_PROTECT * 321 ERROR_MR_UN_PERFORM

Remarks

Screen width is assumed to be 80 characters. The DosPutMessage call counts a CR/LF in the 80 characters that it tries to write to the screen. If a word extends past column 78, it is put on the next line. DosPutMessage assumes the starting cursor position is column one when handling a word wrap.

If the last character to be positioned on a line is a double-byte character that would be bisected, the rule above ensures that the character is not bisected.

Example Code

C Binding

<PRE> #define INCL_DOSMISC

USHORT rc = DosPutMessage(FileHandle, MessageLength, MessageBuffer);

USHORT FileHandle; /* Handle of output file/device */ USHORT MessageLength; /* Length of message buffer */ PCHAR MessageBuffer; /* Message buffer */

USHORT rc; /* return code */ </PRE>

MASM Binding

<PRE> EXTRN DosPutMessage:FAR INCL_DOSMISC EQU 1

PUSH WORD FileHandle ;Handle of output file/device PUSH WORD MessageLength ;Length of message buffer PUSH@ OTHER MessageBuffer ;Message buffer CALL DosPutMessage

Returns WORD </PRE>

Note

Text based on http://www.edm2.com/index.php/DosPutMessage_(FAPI)

Family API
DOS	Process Manager	DosBeep DosExit DosSleep DosExecPgm
File Manager	DosChDir DosChgFilePtr DosClose DosDelete DosDupHandle DosMkDir DosMove DosQCurDir DosQCurDisk DosSetFileMode DosOpen DosQFileInfo DosRead DosQFileMode DosQFSInfo DosQVerify DosRmDir DosSelectDisk DosFindClose DosFindFirst DosFindNext DosSetFileInfo DosSetVerify DosWrite DosFileLocks DosSetFHandState DosNewSize DosBufReset DosQFHandState DosSetFSinfo DosShutdown
Memory Manager	DosFreeSeg DosSubAlloc DosSubFree DosSubSet DosAllocHuge DosAllocSeg DosReallocHuge DosReallocSeg DosGetHugeShift DosCreateCSAlias
NLS	DosCaseMap DosGetCtryInfo DosGetDBCSEv DosSetCtryCode DosGetCollate DosGetMessage DosInsMessage DosPutMessage
Date and Time	DosSetDateTime DosGetDateTime
Devices	DosDevConfig DosDevIOCtl DosDevIOCtl2
Signals	DosHoldSignal DosSetSigHandler
Misc	BadDynLink DosGetEnv DosGetMachineMode DosGetVersion DosError DosErrClass DosSetVec
KBD	KbdCharIn KbdFlushBuffer KbdGetStatus KbdSetStatus KbdStringIn KbdPeek
VIO	VioGetBuf VioGetConfig VioGetCurPos VioGetCurType VioGetPhysBuf VioReadCellStr VioReadCharStr VioScrollUp VioScrollDn VioScrollLf VioScrollRt VioScrUnLock VioSetCurPos VioSetCurType VioSetMode VioGetMode VioShowBuf VioWrtCellStr VioWrtCharStr VioWrtCharStrAtt VioWrtNAttr VioWrtNCell VioWrtNChar VioWrtTTY VioScrLock VioPopUp
Tools	BIND
Modules	DOSCALLS.DLL VIOCALLS.DLL KBDCALLS.DLL MSG.DLL
Libraries	API.LIB OS2386.LIB FAPI.LIB DOSCALLS.LIB SUBCALLS.LIB