Microsoft KB Archive/33252

{|
 * width="100%"|

INFO: Expanded BANDINFO Documentation

 * }

Q33252

3.00 3.10 WINDOWS kbprg

-

The information in this article applies to:


 * Microsoft Windows Software Development Kit (SDK) 3.1

-

SUMMARY
The following is an expanded version of the documentation of the BANDINFO escape in earlier manuals. Refer to the index or table of contents section to determine where the BANDINFO information is located in the current versions of the documentation.

  short Escape(hDC, BANDINFO, nCount, lpInData, lpOutData)

Purpose
Provides better communication between a banding driver and the application.

Parameters
  Parameter     Definition -    --   hDC           A handle to the printer display context

nCount       Not used and can be set to NULL

lpInData     A long pointer to a data structure that has the following structure: typedef struct { BOOL   GraphicsFlag; BOOL   TextFlag; RECT   GraphicsRect; } BANDINFOSTRUCT;

This data structure provides the primary communication between the driver and the application as to what (graphics and/or text) is actually on the page. The notes below describe its use.

lpOutData    A long pointer to a data structure having the same items as lpInData, a BANDINFOSTRUCT

Return Value
  Return Value  Result --  nResult       1 if the function is successful

0 if the function is not successful or if the escape is not implemented

Code Outline
The general outline of a routine using BANDINFO to output a page should be as follows:

  do {

if (BandingDevice) { NEXTBAND BANDINFO }  else {

/* It is not a banding device. */

/* Set the band to the entire page. */       BandRect.left   = 0; BandRect.top   = 0; BandRect.right = dxPrinter; BandRect.bottom = dyPrinter;

/* Output everything. */       BandInfoOut.GraphicsFlag = TRUE; BandInfoOut.TextFlag    = TRUE; }

if (TextFlag) { Do any text. }      if (GraphicsFlag) { Do any graphics. }

} while (BandingDevice &&               more bands to do);

/* NEWFRAME and NEXTBAND are exclusive; however, at least one must be used. Hence we need to do a NEWFRAME if we are not banding. */   if (!BandingDevice) {

/* Put out the page. */   if ((SpoolerError = Escape(hDC, NEWFRAME, 0, 0L, 0L)) <= 0) { Result = ConvertSpoolerError(SpoolerError); Escape(hDC, ABORTDOC, 0, 0L, 0L); goto ErrorExit3; }  } For more information on full-page banding for text, query on the following words:

"prod(winsdk) and four and banding and nonraster" For more information on BANDINFO, query on the following words:

"NEXTBAND and NEWFRAME and BANDINFO and banding and printing" Additional query words: 3.00 3.10

Keywords : kb16bitonly kbOSWin310 _IK kbOSWin300 kbSDKWin16

Issue type : kbinfo

Technology : kbAudDeveloper kbWin3xSearch kbSDKSearch kbWinSDKSearch kbWinSDK310