Re: Getting DEVMODE print job information from PRINTER_NOTIFY_INFO_DATA

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Tim (talbion2_at_hotmail.com)
Date: 08/23/04


Date: 22 Aug 2004 22:32:02 -0700

Thanks for your feedback Duncan.

That is the same DEVMODE structure that I'm using (Windows 2000).

When you total up the size of its elements (4 bytes for long, etc)
it comes out very close to the 174 that the len function returns.

eg Private dm as DEVMODE
Print len( dm ) =>174

So I still can't understand why the adwData points to a structure that is
1172 bytes. I must be missing something obvious.

Cheers

Tim

Duncan.Jones@bigfoot.com (Merrion) wrote in message news:<d57adffd.0408180349.569607fc@posting.google.com>...
> The structure returned is significantly bigger than 174 bytes because
> the structure size depends on the operating system version and the
> device driver can add non standard information after the standard
> DEVMODE structure.
>
> On Windows 2000 the DEVMODE structure is:-
>
> Private Type DEVMODE
> dmDeviceName As String * CCHDEVICENAME
> dmSpecVersion As Integer
> dmDriverVersion As Integer
> dmSize As Integer
> dmDriverExtra As Integer
> dmFields As Long
> dmOrientation As Integer
> dmPaperSize As Integer
> dmPaperLength As Integer
> dmPaperWidth As Integer
> dmScale As Integer
> dmCopies As Integer
> dmDefaultSource As Integer
> dmPrintQuality As Integer
> dmColor As Integer
> dmDuplex As Integer
> dmYResolution As Integer
> dmTTOption As Integer
> dmCollate As Integer
> dmFormName As String * CCHFORMNAME
> dmUnusedPadding As Integer
> dmBitsPerPel As Integer
> dmPelsWidth As Long
> dmPelsHeight As Long
> dmDisplayFlags As Long
> dmDisplayFrequency As Long
> '\\ V4 fields
> dmICMMethod As Long
> dmICMIntent As Long
> dmMediaType As Long
> dmDitherType As Long
> dmReserved1 As Long
> dmReserved2 As Long
> '\\ V5 fields
> dmPanningWidth As Long
> dmPanningHeight As Long
> End Type
>
> Hope this helps,
> Duncan Jones
> Merrion Computing Ltd